Skip to content
This repository
Browse code

Remove #column_index helper; use #column_indices to check for int name

  • Loading branch information...
commit e873392148103a013ec493b80faa697bb467e6cc 1 parent 6390951
Mat Brown authored January 13, 2013

Showing 1 changed file with 2 additions and 6 deletions. Show diff stats Hide diff stats

  1. 8  lib/cassandra-cql/row.rb
8  lib/cassandra-cql/row.rb
@@ -22,12 +22,12 @@ def initialize(row, schema)
22 22
       @row, @schema = row, schema
23 23
       @value_cache = Hash.new { |h, key|
24 24
         # If it's a number and not one of our columns, assume it's an index
25  
-        if key.kind_of?(Fixnum) and !column_names.include?(key)
  25
+        if key.kind_of?(Fixnum) and !column_indices.key?(key)
26 26
           column_name = column_names[key]
27 27
           column_index = key
28 28
         else
29 29
           column_name = key
30  
-          column_index = column_index(key)
  30
+          column_index = column_indices[key]
31 31
         end
32 32
         
33 33
         if column_index.nil?
@@ -53,10 +53,6 @@ def column_indices
53 53
       @column_indices ||= Hash[column_names.each_with_index.to_a]
54 54
     end
55 55
 
56  
-    def column_index(column_name)
57  
-      column_indices[column_name]
58  
-    end
59  
-  
60 56
     def column_values
61 57
       column_names.map do |name|
62 58
         @value_cache[name]

0 notes on commit e873392

Please sign in to comment.
Something went wrong with that request. Please try again.