Skip to content

Commit 2e6ccf4

Browse files
committed
When commiting the fix for hash % dictionary->capacity, some local, in progress edits made it in to the commit. This change backs them out.
1 parent 18a0a3a commit 2e6ccf4

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

JSONKit.m

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,7 +2525,6 @@ static int jk_encode_add_atom_to_buffer(JKEncodeState *encodeState, void *object
25252525
return(0);
25262526
}
25272527

2528-
#if 0
25292528
// When we encounter a class that we do not handle, and we have either a delegate or block that the user supplied to format unsupported classes,
25302529
// we "re-run" the object check. However, we re-run the object check exactly ONCE. If the user supplies an object that isn't one of the
25312530
// supported classes, we fail the second type (i.e., double fault error).
@@ -2553,39 +2552,7 @@ static int jk_encode_add_atom_to_buffer(JKEncodeState *encodeState, void *object
25532552
else { jk_encode_error(encodeState, @"Unable to serialize object class %@ that was returned by the unsupported class formatter. Original object class was %@.", (object == NULL) ? @"NULL" : NSStringFromClass([object class]), NSStringFromClass([encodeCacheObject class])); return(1); }
25542553
}
25552554
}
2556-
#else
25572555

2558-
// When we encounter a class that we do not handle, and we have either a delegate or block that the user supplied to format unsupported classes,
2559-
// we "re-run" the object check. However, we re-run the object check exactly ONCE. If the user supplies an object that isn't one of the
2560-
// supported classes, we fail the second type (i.e., double fault error).
2561-
//BOOL rerunningAfterClassFormatter = NO;
2562-
//rerunAfterClassFormatter:
2563-
2564-
if(
2565-
#ifdef __BLOCKS__
2566-
((encodeState->classFormatterBlock) && ((object = encodeState->classFormatterBlock(object)) == NULL)) ||
2567-
#endif
2568-
((encodeState->classFormatterIMP) && ((object = encodeState->classFormatterIMP(encodeState->classFormatterDelegate, encodeState->classFormatterSelector, object)) == NULL)) ) { goto formatterError; }
2569-
2570-
if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.stringClass)) { isClass = JKClassString; }
2571-
else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.numberClass)) { isClass = JKClassNumber; }
2572-
else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.dictionaryClass)) { isClass = JKClassDictionary; }
2573-
else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.arrayClass)) { isClass = JKClassArray; }
2574-
else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.nullClass)) { isClass = JKClassNull; }
2575-
else {
2576-
if(JK_EXPECT_T([object isKindOfClass:[NSString class]])) { encodeState->fastClassLookup.stringClass = object->isa; isClass = JKClassString; }
2577-
else if(JK_EXPECT_T([object isKindOfClass:[NSNumber class]])) { encodeState->fastClassLookup.numberClass = object->isa; isClass = JKClassNumber; }
2578-
else if(JK_EXPECT_T([object isKindOfClass:[NSDictionary class]])) { encodeState->fastClassLookup.dictionaryClass = object->isa; isClass = JKClassDictionary; }
2579-
else if(JK_EXPECT_T([object isKindOfClass:[NSArray class]])) { encodeState->fastClassLookup.arrayClass = object->isa; isClass = JKClassArray; }
2580-
else if(JK_EXPECT_T([object isKindOfClass:[NSNull class]])) { encodeState->fastClassLookup.nullClass = object->isa; isClass = JKClassNull; }
2581-
else {
2582-
formatterError:
2583-
if(object == encodeCacheObject) { jk_encode_error(encodeState, @"Unable to serialize object class %@.", NSStringFromClass([encodeCacheObject class])); return(1); }
2584-
else { jk_encode_error(encodeState, @"Unable to serialize object class %@ that was returned by the unsupported class formatter. Original object class was %@.", (object == NULL) ? @"NULL" : NSStringFromClass([object class]), NSStringFromClass([encodeCacheObject class])); return(1); }
2585-
}
2586-
}
2587-
2588-
#endif
25892556
// This is here for the benefit of the optimizer. It allows the optimizer to do loop invariant code motion for the JKClassArray
25902557
// and JKClassDictionary cases when printing simple, single characters via jk_encode_write(), which is actually a macro:
25912558
// #define jk_encode_write1(es, dc, f) (_jk_encode_prettyPrint ? jk_encode_write1slow(es, dc, f) : jk_encode_write1fast(es, dc, f))

0 commit comments

Comments
 (0)