> always return the same Object is reduce memory pressure and avoid GC
Yep~ But semantically, messages.next() returns a different address object more intuitive.
Otherwise, someone who call this function downstream need to clearly know that the same object is returned here, which is not logically intuitive and easy to make mistakes.
Yep~ But semantically,
messages.next()
returns a different address object more intuitive. Otherwise, someone who call this function downstream need to clearly know that the same object is returned here, which is not logically intuitive and easy to make mistakes.Do we have some more elegant solutions?
Originally posted by @diaohancai in https://github.com/apache/incubator-hugegraph-computer/issues/275#issuecomment-1779336049