diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-02-08 17:01:14 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-02-08 17:01:14 +0200 |
commit | fe9b4a38888f82c0e4541cf31660d1e4329ac20d (patch) | |
tree | 28b10a69d1407122088bec06786d20321368f5a8 /src/database.c | |
parent | 3320fba50d8be0f12d4d01f7c12824a4dd504ac9 (diff) | |
download | apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.tar.gz apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.tar.bz2 apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.tar.xz apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.zip |
blob: optimize spn and cspn
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/database.c b/src/database.c index d546d7e..e084b8b 100644 --- a/src/database.c +++ b/src/database.c @@ -33,6 +33,11 @@ #include "apk_archive.h" #include "apk_print.h" +static const apk_spn_match_def apk_spn_repo_separators = { + [4] = (1<<0) /* */, + [7] = (1<<2) /*:*/, +}; + enum { APK_DISALLOW_RMDIR = 0, APK_ALLOW_RMDIR = 1 @@ -1770,8 +1775,8 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t _repository) if (brepo.ptr[0] == '@') { apk_blob_pull_char(&brepo, '@'); - apk_blob_cspn(brepo, ": ", &btag, &brepo); - apk_blob_spn(brepo, ": ", NULL, &brepo); + apk_blob_cspn(brepo, apk_spn_repo_separators, &btag, &brepo); + apk_blob_spn(brepo, apk_spn_repo_separators, NULL, &brepo); tag_id = apk_db_get_tag_id(db, btag); } |