Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7012a75

Browse files
committed
remove useless kind_of?
1 parent bd1d965 commit 7012a75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎lib/regexp_trie.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def add(str)
2626
entry[c] ||= {}
2727
entry = entry[c]
2828
end
29-
entry[:end] = true
29+
entry[:end] = nil
3030
self
3131
end
3232

@@ -42,14 +42,14 @@ def to_regexp(option = nil)
4242
private
4343

4444
def build(entry)
45-
return nil if entry[:end] && entry.size == 1
45+
return nil if entry.include?(:end) && entry.size == 1
4646

4747
alt = []
4848
cc = []
4949
q = false
5050

5151
entry.keys.each do |c|
52-
if entry[c].kind_of?(Hash)
52+
if entry[c]
5353
recurse = build(entry[c])
5454
qc = Regexp.quote(c)
5555
if recurse

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /