Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
update packages store func
Browse files Browse the repository at this point in the history
oops

oops
  • Loading branch information
eebssk1 committed May 26, 2021
1 parent 5ecda6c commit a19d454
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions module/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <dirent.h>
#include <nativehelper/scoped_utf_chars.h>
#include "dobby.h"
#include <unordered_set>

#define UNLIKELY(x) __builtin_expect(!!(x), 0)
#define LIKELY(x) __builtin_expect(!!(x), 1)
Expand Down Expand Up @@ -77,7 +78,7 @@ namespace Config {
#define PACKAGES_PATH CONFIG_PATH "/packages"

static std::map<std::string, Property *> props;
static std::vector<std::string> packages;
static std::unordered_set <std::string> packages ;
static int serm = 10086;

Property *Properties::Find(const char *name) {
Expand All @@ -98,12 +99,12 @@ namespace Config {

bool Packages::Find(const char *name) {
if (UNLIKELY(!name)) return false;
return std::find(packages.begin(), packages.end(), name) != packages.end();
return packages.find(name) != packages.end();
}

void Packages::Add(const char *name) {
if (UNLIKELY(!name)) return;
packages.emplace_back(name);
packages.insert(name);
}

static void Load() {
Expand Down Expand Up @@ -449,4 +450,4 @@ RiruVersionedModuleInfo *init(Riru *riru) {
}
}
#endif
}
}

0 comments on commit a19d454

Please sign in to comment.