Skip to content

Commit

Permalink
Merge pull request #280 from criteo-forks/on_sparse_key_perf
Browse files Browse the repository at this point in the history
Avoid sparse key read for non sparse secrets
  • Loading branch information
thommay authored Jun 7, 2017
2 parents a20cc74 + 42f2aa6 commit 9aaeb75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chef-vault/item_keys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def include?(key)
ckey = @cache[key]
return (ckey ? true : false) unless ckey.nil?
# check if the key is saved in sparse mode
return true unless sparse_key(sparse_id(key)).nil?
return true if sparse? && sparse_key(sparse_id(key))
# fallback to non-sparse mode if sparse key is not found
@raw_data.keys.include?(key)
end
Expand Down

0 comments on commit 9aaeb75

Please sign in to comment.