summaryrefslogtreecommitdiffstats
path: root/lib/sqlite3
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2008-01-26 17:40:44 +0000
committerJamis Buck <jamis@37signals.com>2008-01-26 17:40:44 +0000
commitff8eb33767c36aa0fdeb1c23e0b60f58767aad7a (patch)
treedd7c9b9f4445776a2e7fd7aa1d230809bf98650e /lib/sqlite3
parentd3cdae069ec5e416737bae1593009ca89c163046 (diff)
downloadthird_party-sqlite3-ruby-ff8eb33767c36aa0fdeb1c23e0b60f58767aad7a.tar.gz
third_party-sqlite3-ruby-ff8eb33767c36aa0fdeb1c23e0b60f58767aad7a.tar.xz
third_party-sqlite3-ruby-ff8eb33767c36aa0fdeb1c23e0b60f58767aad7a.zip
use if/elsif rather than case, for slight performance improvement (thanks Erik Veenstra)
Diffstat (limited to 'lib/sqlite3')
-rw-r--r--lib/sqlite3/resultset.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/sqlite3/resultset.rb b/lib/sqlite3/resultset.rb
index ed2cb58..0b496b6 100644
--- a/lib/sqlite3/resultset.rb
+++ b/lib/sqlite3/resultset.rb
@@ -121,13 +121,14 @@ module SQLite3
unless @eof
row = []
@driver.data_count( @stmt.handle ).times do |column|
- case @driver.column_type( @stmt.handle, column )
- when Constants::ColumnType::NULL then
- row << nil
- when Constants::ColumnType::BLOB then
- row << @driver.column_blob( @stmt.handle, column )
- else
- row << @driver.column_text( @stmt.handle, column )
+ type = @driver.column_type( @stmt.handle, column )
+
+ if type == Constants::ColumnType::NULL
+ row << nil
+ elsif type == Constants::ColumnType::BLOB
+ row << @driver.column_blob( @stmt.handle, column )
+ else
+ row << @driver.column_text( @stmt.handle, column )
end
end