@@ -4468,7 +4468,6 @@ static VALUE
44684468check_limit (VALUE str , VALUE opt )
44694469{
44704470 size_t slen , limit ;
4471- if (NIL_P (str )) return str ;
44724471 StringValue (str );
44734472 slen = RSTRING_LEN (str );
44744473 limit = get_limit (opt );
@@ -4620,7 +4619,7 @@ date_s__iso8601(int argc, VALUE *argv, VALUE klass)
46204619 VALUE str , opt ;
46214620
46224621 rb_scan_args (argc , argv , "1:" , & str , & opt );
4623- str = check_limit (str , opt );
4622+ if (! NIL_P ( str )) str = check_limit (str , opt );
46244623
46254624 return date__iso8601 (str );
46264625}
@@ -4690,7 +4689,7 @@ date_s__rfc3339(int argc, VALUE *argv, VALUE klass)
46904689 VALUE str , opt ;
46914690
46924691 rb_scan_args (argc , argv , "1:" , & str , & opt );
4693- str = check_limit (str , opt );
4692+ if (! NIL_P ( str )) str = check_limit (str , opt );
46944693
46954694 return date__rfc3339 (str );
46964695}
@@ -4759,7 +4758,7 @@ date_s__xmlschema(int argc, VALUE *argv, VALUE klass)
47594758 VALUE str , opt ;
47604759
47614760 rb_scan_args (argc , argv , "1:" , & str , & opt );
4762- str = check_limit (str , opt );
4761+ if (! NIL_P ( str )) str = check_limit (str , opt );
47634762
47644763 return date__xmlschema (str );
47654764}
@@ -4828,7 +4827,7 @@ date_s__rfc2822(int argc, VALUE *argv, VALUE klass)
48284827 VALUE str , opt ;
48294828
48304829 rb_scan_args (argc , argv , "1:" , & str , & opt );
4831- str = check_limit (str , opt );
4830+ if (! NIL_P ( str )) str = check_limit (str , opt );
48324831
48334832 return date__rfc2822 (str );
48344833}
@@ -4896,7 +4895,7 @@ date_s__httpdate(int argc, VALUE *argv, VALUE klass)
48964895 VALUE str , opt ;
48974896
48984897 rb_scan_args (argc , argv , "1:" , & str , & opt );
4899- str = check_limit (str , opt );
4898+ if (! NIL_P ( str )) str = check_limit (str , opt );
49004899
49014900 return date__httpdate (str );
49024901}
@@ -4965,7 +4964,7 @@ date_s__jisx0301(int argc, VALUE *argv, VALUE klass)
49654964 VALUE str , opt ;
49664965
49674966 rb_scan_args (argc , argv , "1:" , & str , & opt );
4968- str = check_limit (str , opt );
4967+ if (! NIL_P ( str )) str = check_limit (str , opt );
49694968
49704969 return date__jisx0301 (str );
49714970}
0 commit comments