@@ -41,8 +41,6 @@ private static readonly IDictionary<Type, IDictionary<string, string>>
4141 private readonly LinkedList < IDictionary < string , IParseFieldOperation > > operationSetQueue =
4242 new LinkedList < IDictionary < string , IParseFieldOperation > > ( ) ;
4343 private readonly IDictionary < string , object > estimatedData = new Dictionary < string , object > ( ) ;
44- private readonly IDictionary < object , ParseJSONCacheItem > hashedObjects =
45- new Dictionary < object , ParseJSONCacheItem > ( ) ;
4644
4745 private static readonly ThreadLocal < bool > isCreatingPointer = new ThreadLocal < bool > ( ( ) => false ) ;
4846
@@ -430,10 +428,7 @@ internal virtual void MergeFromServer(IObjectState serverState) {
430428
431429 foreach ( var pair in serverState ) {
432430 var value = pair . Value ;
433- if ( ParseClient . IsContainerObject ( value ) ) {
434- // Fill in the cache.
435- AddToHashedObjects ( value ) ;
436- } else if ( value is ParseObject ) {
431+ if ( value is ParseObject ) {
437432 // Resolve fetched object.
438433 var parseObject = value as ParseObject ;
439434 if ( fetchedObject . ContainsKey ( parseObject . ObjectId ) ) {
@@ -485,58 +480,6 @@ private bool HasDirtyChildren {
485480 }
486481 }
487482
488- /// <summary>
489- /// Updates the JSON cache value for the given object.
490- /// </summary>
491- private void CheckpointMutableContainer ( object obj ) {
492- lock ( mutex ) {
493- if ( ParseClient . IsContainerObject ( obj ) ) {
494- hashedObjects [ obj ] = new ParseJSONCacheItem ( obj ) ;
495- }
496- }
497- }
498-
499- /// <summary>
500- /// Inspects to see if a given mutable container owned by this object has
501- /// been mutated, and treats any mutation as a new "set" operation.
502- /// </summary>
503- private void CheckForChangesToMutableContainer ( string key , object obj ) {
504- lock ( mutex ) {
505- if ( ParseClient . IsContainerObject ( obj ) ) {
506- ParseJSONCacheItem oldCacheItem ;
507- hashedObjects . TryGetValue ( obj , out oldCacheItem ) ;
508- if ( oldCacheItem == null ) {
509- throw new ArgumentException ( "ParseObjects contains container item that isn't cached." ) ;
510- }
511- var newCacheItem = new ParseJSONCacheItem ( obj ) ;
512- if ( ! oldCacheItem . Equals ( newCacheItem ) ) {
513- // A mutable container changed out from under us. Treat it as a set operation.
514- PerformOperation ( key , new ParseSetOperation ( obj ) ) ;
515- }
516- } else {
517- if ( obj != null ) {
518- hashedObjects . Remove ( obj ) ;
519- }
520- }
521- }
522- }
523-
524- /// <summary>
525- /// Inspects to see if any mutable container owned by this object has been mutated, and
526- /// treats any mutation as a new 'Set' operation.
527- /// </summary>
528- internal void CheckForChangesToMutableContainers ( ) {
529- lock ( mutex ) {
530- foreach ( var pair in new Dictionary < string , object > ( estimatedData ) ) {
531- CheckForChangesToMutableContainer ( pair . Key , pair . Value ) ;
532- }
533- var toRemove = hashedObjects . Keys . Except ( estimatedData . Values ) . ToArray ( ) ;
534- foreach ( var key in toRemove ) {
535- hashedObjects . Remove ( key ) ;
536- }
537- }
538- }
539-
540483 /// <summary>
541484 /// Flattens dictionaries and lists into a single enumerable of all contained objects
542485 /// that can then be queried over.
@@ -1149,10 +1092,6 @@ internal void RebuildEstimatedData() {
11491092 foreach ( var operations in operationSetQueue ) {
11501093 ApplyOperations ( operations , estimatedData ) ;
11511094 }
1152- hashedObjects . Clear ( ) ;
1153- foreach ( var pair in estimatedData ) {
1154- CheckpointMutableContainer ( pair . Value ) ;
1155- }
11561095 // We've just applied a bunch of operations to estimatedData which
11571096 // may have changed all of its keys. Notify of all keys and properties
11581097 // mapped to keys being changed.
@@ -1184,7 +1123,6 @@ internal void PerformOperation(string key, IParseFieldOperation operation) {
11841123 OnPropertyChanged ( "IsDirty" ) ;
11851124 }
11861125
1187- CheckpointMutableContainer ( newValue ) ;
11881126 OnFieldsChanged ( new [ ] { key } ) ;
11891127 }
11901128 }
@@ -1493,12 +1431,6 @@ public ICollection<string> Keys {
14931431 }
14941432 }
14951433
1496- internal void AddToHashedObjects ( object obj ) {
1497- lock ( mutex ) {
1498- hashedObjects [ obj ] = new ParseJSONCacheItem ( obj ) ;
1499- }
1500- }
1501-
15021434 /// <summary>
15031435 /// Gets or sets the ParseACL governing this object.
15041436 /// </summary>
@@ -1588,7 +1520,6 @@ public bool IsKeyDirty(string key) {
15881520
15891521 private bool CheckIsDirty ( bool considerChildren ) {
15901522 lock ( mutex ) {
1591- CheckForChangesToMutableContainers ( ) ;
15921523 return ( dirty || CurrentOperations . Count > 0 || ( considerChildren && HasDirtyChildren ) ) ;
15931524 }
15941525 }
0 commit comments