diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-11-09 21:28:55 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-11-09 21:50:11 +0200 |
commit | c60b7424a0e0b12540112bc14d42f3214f214cd6 (patch) | |
tree | ecdda4565bb3498bd2318786beb663d46216f683 /src/app_manifest.c | |
parent | 7c8f8725724a54538ddd4ae03404276725f4fb8f (diff) | |
download | apk-tools-c60b7424a0e0b12540112bc14d42f3214f214cd6.tar.gz apk-tools-c60b7424a0e0b12540112bc14d42f3214f214cd6.tar.bz2 apk-tools-c60b7424a0e0b12540112bc14d42f3214f214cd6.tar.xz apk-tools-c60b7424a0e0b12540112bc14d42f3214f214cd6.zip |
optimize apk_pathbuilder_pop to get the old length
avoids memrchr
Diffstat (limited to 'src/app_manifest.c')
-rw-r--r-- | src/app_manifest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/app_manifest.c b/src/app_manifest.c index 5c2e085..a9d82d5 100644 --- a/src/app_manifest.c +++ b/src/app_manifest.c @@ -96,7 +96,7 @@ static int process_v3_meta(struct apk_extract_ctx *ectx, struct adb_obj *pkg) struct apk_pathbuilder pb; char buf[APK_DIGEST_MAX_LENGTH*2+1]; apk_blob_t hex; - int i, j; + int i, j, n; adb_ro_obj(pkg, ADBI_PKG_PATHS, &paths); @@ -107,7 +107,7 @@ static int process_v3_meta(struct apk_extract_ctx *ectx, struct adb_obj *pkg) for (j = ADBI_FIRST; j <= adb_ra_num(&files); j++) { adb_ro_obj(&files, j, &file); - apk_pathbuilder_pushb(&pb, adb_ro_blob(&file, ADBI_FI_NAME)); + n = apk_pathbuilder_pushb(&pb, adb_ro_blob(&file, ADBI_FI_NAME)); apk_digest_from_blob(&digest, adb_ro_blob(&file, ADBI_FI_HASHES)); hex = APK_BLOB_BUF(buf); @@ -118,7 +118,7 @@ static int process_v3_meta(struct apk_extract_ctx *ectx, struct adb_obj *pkg) mctx->prefix1, mctx->prefix2, apk_digest_alg_str(digest.alg), buf, apk_pathbuilder_cstr(&pb)); - apk_pathbuilder_pop(&pb); + apk_pathbuilder_pop(&pb, n); } } |