]> git.saurik.com Git - cycript.git/commitdiff
Remove duplicated manually-pooled Type constructor.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 13 Oct 2014 11:07:03 +0000 (04:07 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 13 Oct 2014 11:07:29 +0000 (04:07 -0700)
Internal.hpp
ObjectiveC/Library.mm

index e594e55fe6d6cfd7e96f1603ccbdbeb2190b9a1e..9bd4012c87fcf602a9b9ea0d12caf8e476851d82 100644 (file)
@@ -53,15 +53,6 @@ struct Type_privateData :
         sig::Copy(*pool_, *type_, *type);
     }
 
-    Type_privateData(CYPool &pool, const char *type) :
-        CYData(pool),
-        ffi_(NULL)
-    {
-        sig::Signature signature;
-        sig::Parse(*pool_, &signature, type, &Structor_);
-        type_ = signature.elements[0].type;
-    }
-
     Type_privateData(const char *type) :
         ffi_(NULL)
     {
index a5a99a44c993c2bf8d6daf1462ddfa9d7c255630..dce14d7d6d8dd8cb7d6e70b4048240b7ecd97b81 100644 (file)
@@ -2099,8 +2099,8 @@ static JSValueRef Internal_getProperty(JSContextRef context, JSObjectRef object,
             uintptr_t mask((1 << length) - 1);
             return CYCastJSValue(context, (field >> shift) & mask);
         } else {
-            Type_privateData type(pool, ivar_getTypeEncoding(ivar));
-            return CYFromFFI(context, type.type_, type.GetFFI(), data);
+            auto type(new(pool) Type_privateData(ivar_getTypeEncoding(ivar)));
+            return CYFromFFI(context, type->type_, type->GetFFI(), data);
         }
     }
 
@@ -2128,8 +2128,8 @@ static bool Internal_setProperty(JSContextRef context, JSObjectRef object, JSStr
             uintptr_t mask((1 << length) - 1);
             field = field & ~(mask << shift) | (uintptr_t(CYCastDouble(context, value)) & mask) << shift;
         } else {
-            Type_privateData type(pool, ivar_getTypeEncoding(ivar));
-            CYPoolFFI(&pool, context, type.type_, type.GetFFI(), reinterpret_cast<uint8_t *>(self) + ivar_getOffset(ivar), value);
+            auto type(new(pool) Type_privateData(ivar_getTypeEncoding(ivar)));
+            CYPoolFFI(&pool, context, type->type_, type->GetFFI(), reinterpret_cast<uint8_t *>(self) + ivar_getOffset(ivar), value);
             return true;
         }
     }