Open kdy1 opened 3 years ago
Yeah, this would be good. I also still think there are race conditions in with_leading
and with_trailing
where two threads might remove one after the other and one thread would end up with different comments.
Edit: I have opened #2001 which fixes this race condition until the redesign.
It seems like a misdesign.
Problems
Convenience
API is tricky because of comments.
Performance
The current design makes
fixer
slow because it requires moving comments in hashmap again and again. Moving comments involves acquiring / releasing lock and rehashing.It can be improved using buffer, but maybe there is a fundamental problem.
cc @dsherret as you may be interested in this.