<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -143,22 +143,16 @@ module TypeLib
         def __getobj__
             return @cache if @cache
 
-            @cache = case @bare_obj
-                     when Hash
-                         hash = { }
-                         @bare_obj.each_key do |key|
-                             hash[key] = @type_map[key] ? @converter.convert(@type_map[key], @bare_obj[key]) : @bare_obj[key]
-                         end
-                         hash
-                     when Array
-                         array = [ ]
-                         @bare_obj.each_with_index do |obj, i|
-                             array.push @type_map[i] ? @converter.convert(@type_map[i], obj) : obj
-                         end
-                         array
-                     else
-                         raise &quot;Trouble figuring out what class to deal with during on-the-fly convert? Probably a bug.&quot;
-                     end
+            @cache = []
+
+            case @bare_obj
+            when Hash
+                @bare_obj.each_key   { |x| convert_object(x) }
+            when Array
+                @bare_obj.each_index { |x| convert_object(x) }
+            else
+                raise &quot;Trouble figuring out what class to deal with during on-the-fly convert? Probably a bug.&quot;
+            end
 
             if @cache and !self.class.debug
                 @bare_obj = nil
@@ -166,5 +160,11 @@ module TypeLib
 
             @cache
         end
+
+        protected
+
+        def convert_object(key)
+            @cache[key] = @type_map[key] ? @converter.convert(@type_map[key], @bare_obj[key]) : @bare_obj[key]
+        end
     end
 end</diff>
      <filename>lib/typelib.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d0327d1b926484dd430bdf581915c08689da6d6c</id>
    </parent>
  </parents>
  <author>
    <name>Erik Hollensbe</name>
    <email>erikh@speyside.localdomain</email>
  </author>
  <url>http://github.com/erikh/typelib/commit/b1e1ab12de5101dbddefd8d0dc11b3ebb52a58da</url>
  <id>b1e1ab12de5101dbddefd8d0dc11b3ebb52a58da</id>
  <committed-date>2009-10-18T05:08:04-07:00</committed-date>
  <authored-date>2009-10-18T05:08:04-07:00</authored-date>
  <message>* A little cleanup, suggested by yxhuvud.</message>
  <tree>dbf0e7c3049d97490fb66eb3571540a78afc8882</tree>
  <committer>
    <name>Erik Hollensbe</name>
    <email>erikh@speyside.localdomain</email>
  </committer>
</commit>
