Ver Fonte

Loop over only changed keypaths in request serializer (#4581)

Elf Sundae há 5 anos atrás
pai
commit
852ec56707
1 ficheiros alterados com 2 adições e 4 exclusões
  1. 2 4
      AFNetworking/AFURLRequestSerialization.m

+ 2 - 4
AFNetworking/AFURLRequestSerialization.m

@@ -368,10 +368,8 @@ forHTTPHeaderField:(NSString *)field
     NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:url];
     mutableRequest.HTTPMethod = method;
 
-    for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) {
-        if ([self.mutableObservedChangedKeyPaths containsObject:keyPath]) {
-            [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath];
-        }
+    for (NSString *keyPath in self.mutableObservedChangedKeyPaths) {
+        [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath];
     }
 
     mutableRequest = [[self requestBySerializingRequest:mutableRequest withParameters:parameters error:error] mutableCopy];