File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,14 @@ SLOT_RULE['M'] = Minute
81
81
SLOT_RULE[' S' ] = Second
82
82
SLOT_RULE[' s' ] = Millisecond
83
83
84
- duplicates (slots) = any (map (x-> count (y-> x. parser== y. parser,slots),slots) .> 1 )
84
+ function anyduplicates (slots)
85
+ for i = 1 : length (slots), j = i+ 1 : length (slots)
86
+ if slots[i]. parser == slots[j]. parser
87
+ return true
88
+ end
89
+ end
90
+ return false
91
+ end
85
92
86
93
"""
87
94
DateFormat(format::AbstractString, locale::AbstractString="english") -> DateFormat
@@ -130,7 +137,7 @@ function DateFormat(f::AbstractString, locale::AbstractString="english")
130
137
push! (slots,slot)
131
138
end
132
139
133
- duplicates (slots) && throw (ArgumentError (" Two separate periods of the same type detected" ))
140
+ anyduplicates (slots) && throw (ArgumentError (" Two separate periods of the same type detected" ))
134
141
return DateFormat (slots,prefix,locale)
135
142
end
136
143
You can’t perform that action at this time.
0 commit comments