Skip to content

Commit

Permalink
40-50% performance fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanhimmelman committed Feb 11, 2016
1 parent 6f5d1aa commit a5f9b06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ObjectMapper/Core/Map.swift
Expand Up @@ -53,7 +53,8 @@ public final class Map {
/// The Key paramater can be a period separated string (ex. "distance.value") to access sub objects.
public subscript(key: String) -> Map {
// save key and value associated to it
return self[key, nested: true]
let nested = key.containsString(".")
return self[key, nested: nested]
}

public subscript(key: String, nested nested: Bool) -> Map {
Expand Down

0 comments on commit a5f9b06

Please sign in to comment.