Skip to content

Commit d64d4f9

Browse files
committed
perf
1 parent 1b6e6bb commit d64d4f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/java_time/single_field.cljc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
(long our-value)))
3737

3838
(defmacro enumerated-entity [tp doc & {:keys [unit]}]
39+
(assert (string? doc))
3940
(let [tp (resolve-tag tp)
4041
fname (with-meta (symbol (jt.u/dashize (-> (str tp) (string/split #"\.") last))) {:tag tp})
4142
fields (symbol (str fname "-fields"))]
@@ -90,6 +91,7 @@
9091
o# os#)))))))))
9192

9293
(defmacro single-field-entity [tp doc & {:keys [parseable?]}]
94+
(assert (string? doc))
9395
(let [^Class tpcls (resolve tp)
9496
tp (symbol (.getName tpcls))
9597
fname (with-meta (symbol (jt.u/dashize (-> (str tp) (string/split #"\.") last))) {:tag tp})
@@ -132,12 +134,13 @@
132134

133135
(defmacro two-field-entity [tp doc & {:keys [major-field-types major-field-ctor
134136
minor-field-ctor minor-field-default]}]
137+
(assert (string? doc))
135138
(let [[major-field-ctor major-field-type] major-field-ctor
136139
[minor-field-ctor minor-field-type] minor-field-ctor
137140
major-field-type (resolve-tag major-field-type)
138141
minor-field-type (resolve-tag minor-field-type)
139142
tp (resolve-tag tp)
140-
fname (with-meta (symbol (jt.u/dashize (-> (str tp) (string/split #"\.") last))) {:tag tp})
143+
fname (with-meta (symbol (jt.u/dashize (-> (str tp) (string/split #"\.") peek))) {:tag tp})
141144
arg (gensym)
142145
tmp-major (with-meta (gensym) {:tag major-field-type})
143146
tmp-minor (with-meta (gensym) {:tag minor-field-type})]

0 commit comments

Comments
 (0)