depot/third_party/nixpkgs/pkgs/by-name/an/ananicy-cpp/match-wrappers.patch
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

16 lines
614 B
Diff

diff --git a/src/worker.cpp b/src/worker.cpp
index 0cf8955..b9dc70f 100644
--- a/src/worker.cpp
+++ b/src/worker.cpp
@@ -29,7 +29,10 @@ void Worker::work(const std::stop_token &stop_token) {
while (!stop_token.stop_requested()) {
while ((proc = process_queue->poll(500ms)).has_value()) {
const auto &p = proc.value();
- const auto &rule = rules->get_rule(p.name);
+ auto name = p.name;
+ if (name.starts_with('.') && name.ends_with("-wrapped"))
+ name = name.substr(1, name.find_last_of('-') - 1);
+ const auto &rule = rules->get_rule(name);
processed_count++;