simplify logic

This commit is contained in:
Steve Shreeve 2010-03-13 15:24:05 -05:00 committed by Kyle Banker
parent 4a1bccefae
commit 5e81cf2f82
1 changed files with 1 additions and 4 deletions

View File

@ -53,10 +53,7 @@ module BSON
#
# @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