adiar
adiar copied to clipboard
Simplify `levelized_file_writer.has_pushed()` implementation
The implementation of meta_writer::has_pushed()
can be replaced with size() > 0 || levels() > 0
. This would remove almost identical code, but would also be slower than the current piece of code, since it does not return early.
Originally posted by @AnnaBlume99 in https://github.com/SSoelvsten/adiar/pull/315#discussion_r854093962
Right now, has_pushed
is only ever used once per algorithm. That is, any small performance decrease is not really noteworthy. So, the improvement in code quality in comparison to the (almost non-existing) performance decrease is (arguably) worth it.