rb: Speed up Struct#initialize for optional fields [THRFIT-112]
authorKevin Clark <kclark@apache.org>
Mon, 25 Aug 2008 21:34:19 +0000 (21:34 +0000)
committerKevin Clark <kclark@apache.org>
Mon, 25 Aug 2008 21:34:19 +0000 (21:34 +0000)
commit38a2ce635de89fe2e3686e04b8f146c853c4bfa0
tree99ecbb4f7c570e14cd4c835a1a68777535d26a3d
parent14fe791ef36d84a16abdafd67d87ff85e8780924
rb: Speed up Struct#initialize for optional fields [THRFIT-112]

Struct#initialize previously walked over every field and checked for
default values before assigning nil. The new approach assigns defaults
only to fields that have defaults, and lets Ruby handle nil ivars.

Author: Bryan Duxbury

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@688891 13f79535-47bb-0310-9956-ffa450edef68
lib/rb/lib/thrift/struct.rb
lib/rb/spec/struct_spec.rb