Skip to content

Commit

Permalink
simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
shreeve authored and banker committed Nov 11, 2010
1 parent 4a1bcce commit 5e81cf2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/bson/types/object_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ def initialize(data=nil)
#
# @return [Boolean]
def self.legal?(str)
len = 24
str =~ /([0-9a-f]+)/i
match = $1
str && str.length == len && match == str
str =~ /^[0-9a-f]{24}$/i ? true : false
end

# Create an object id from the given time. This is useful for doing range
Expand Down

0 comments on commit 5e81cf2

Please sign in to comment.