ulfox / dby

Simple Yaml DB
MIT License
59 stars 6 forks source link

Method GetFirst returns the first key found in a branch #7

Closed ulfox closed 3 years ago

ulfox commented 3 years ago

Describe the bug Method GetFirst returns the first key that is found in the branch and not in the hierarchy. This appears to be the case when the a branch that has the key is processed first.

Example:


key-1:
    key-2:
        key-3: value-1
    key-3:  value-2

Desired result for GetFirst("key-3") is value-2 but instead we get value-1

To Reproduce Run GetFirst("someKey") with 2 keys

Expected behaviour GetFirst should return value-1

ulfox commented 3 years ago

Fixed by: https://github.com/ulfox/dby/pull/8