message: Fix `use empty()` tidy warning
  Summary:
  Silence the linter by fixing the issue.
  Move the code, which is a decent chunk, to its own function. Use an assert instead of a weird `exit` + logging (which would never log).
diff: @@ -874,6 +874,45 @@ void dump_keep_reasons(const ConfigFiles& conf,
  }
  }
  +void process_proguard_rules(ConfigFiles& conf,
  + Scope& scope,
  + Scope& external_classes,
  + keep_rules::ProguardConfiguration& pg_config) {
  + bool keep_all_annotation_classes;
  + conf.get_json_config().get("keep_all_annotation_classes", true,
  + keep_all_annotation_classes);
  +
  + ConcurrentSet<const keep_rules::KeepSpec*> unused_rules =
  + process_proguard_rules(conf.get_proguard_map(), scope, external_classes,
  + pg_config, keep_all_annotation_classes);
  + if (!unused_rules.empty()) {
  + std::vector<std::string> out;
  + for (const keep_rules::KeepSpec* keep_rule : unused_rules) {
  + out.push_back(keep_rules::show_keep(*keep_rule));
  + }
  + // Make output deterministic
  + std::sort(out.begin(), out.end());
  + bool unused_rule_abort;
  + conf.get_json_config().get("unused_keep_rule_abort", false,
  + unused_rule_abort);
  + always_assert_log(!unused_rule_abort, "%s",
  + [&]() {
  + std::string tmp;
  + for (const auto& s : out) {
  + tmp += s;
  + tmp += " not used\n";
  + }
  + return tmp;
  + }()
  + .c_str());
  +
  + std::ofstream ofs{conf.metafile("redex-unused-keep-rules.txt")};
  + for (const auto& s : out) {
  + ofs << s << "\n";
  + }
  + }
  +}
  +
  /**
  * Pre processing steps: load dex and configurations
  */
  @@ -1009,37 +1048,7 @@ void redex_frontend(ConfigFiles& conf, /* input */
  Scope scope = build_class_scope(it);
  {
  Timer t("Processing proguard rules");
  -
  - bool keep_all_annotation_classes;
  - json_config.get("keep_all_annotation_classes", true,
  - keep_all_annotation_classes);
  -
  - ConcurrentSet<const keep_rules::KeepSpec*> unused_rules =
  - process_proguard_rules(conf.get_proguard_map(), scope, external_classes,
  - pg_config, keep_all_annotation_classes);
  - if (unused_rules.size() > 0) {
  - std::vector<std::string> out;
  - for (const keep_rules::KeepSpec* keep_rule : unused_rules) {
  - out.push_back(keep_rules::show_keep(*keep_rule));
  - }
  - // Make output deterministic
  - std::sort(out.begin(), out.end());
  - bool unused_rule_abort;
  - conf.get_json_config().get("unused_keep_rule_abort", false,
  - unused_rule_abort);
  - if (unused_rule_abort) {
  - exit(1);
  - for (const auto& s : out) {
  - fprintf(stderr, "%s not used\n", s.c_str());
  - }
  - }
  - auto fd =
  - fopen(conf.metafile("redex-unused-keep-rules.txt").c_str(), "w");
  - for (const auto& s : out) {
  - fprintf(fd, "%s\n", s.c_str());
  - }
  - fclose(fd);
  - }
  + process_proguard_rules(conf, scope, external_classes, pg_config);
  }
  {
  Timer t("No Optimizations Rules");
  