Skip to content

Commit

Permalink
Avoid unnecessarily removing keys from ConfigObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
jcazevedo committed Oct 10, 2019
1 parent 2e521fc commit da14c87
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -61,7 +61,7 @@ object MapShapedReader {
case keyCur => headReader.from(keyCur)
}
// for performance reasons only, we shouldn't clone the config object unless necessary
val tailCur = if (hint.allowUnknownKeys) cur.withoutKey(keyStr) else cur.withoutKey(keyStr)
val tailCur = if (hint.allowUnknownKeys) cur else cur.withoutKey(keyStr)
val tailResult = tConfigReader.value.fromWithDefault(tailCur, default.tail)
ConfigReader.Result.zipWith(headResult, tailResult)((head, tail) => field[K](head) :: tail)
}
Expand Down

0 comments on commit da14c87

Please sign in to comment.