Browse files

remove conditional logic

  • Loading branch information...
1 parent 088d781 commit 205fa750b896d1209b4a1c6e7d9ce05ae6b2ce19 @infused committed Jul 14, 2014
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/dbf/column/base.rb
View
6 lib/dbf/column/base.rb
@@ -158,10 +158,8 @@ def schema_data_type #nodoc
end
def clean(value) #nodoc
- value.strip!
- first_null = value.index("\x00")
- value = value[0, first_null] if first_null
- value.gsub(/[^\x20-\x7E]/, "")
+ truncated_value = value.strip.partition("\x00").first
+ truncated_value.gsub(/[^\x20-\x7E]/, '')
end
end

0 comments on commit 205fa75

Please sign in to comment.