neo4jrb/neo4j-core — pull request #137 by cenouro (2014-11-29 14:36:00+00:00)
Title: Refactor

I made a Venn diagram and it seems the code could be simplified. All specs are passing, but I am not sure if the specs are good enough to capture the desired behavior (specially regarding non-unique labels). I also am not sure if this refactoring will impact performance (it does not seem likely).

Please review the code and also the specs. Thanks.

![venn_diagram](https://cloud.githubusercontent.com/assets/5600078/5234793/c47bed06-77c3-11e4-8071-74e219437f98.jpeg)

The Venn diagram shows that labels are always discarded. `to_keep` would never have repeated elements in the old code. `to_set` could contain repeated elements, if I am no mistaken. The new code makes sure no repeated elements will be included.