From 4fa973840f0a0e2cbb16f5e3341c0625793af2ed Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 05:56:56 +0900 Subject: refactor(php-shim): drop pack/unpack in favor of direct byte handling The only callers were trivial fixed-format uses: reading the first four hash bytes as a native int, splitting in_addr byte strings, and building a constant ZIP EOCD record. Each site now does the byte manipulation directly, so the general-purpose shims are no longer needed. Co-Authored-By: Claude Fable 5 --- .../src/dependency_resolver/multi_conflict_rule.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs') diff --git a/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs b/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs index bfbfc82a..0936dd0c 100644 --- a/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs +++ b/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs @@ -57,19 +57,8 @@ impl MultiConflictRule { "sha1" }; let binary = hash_raw(algo, &format!("c:{}", joined)); - let data = shirabe_php_shim::unpack("ihash", &binary); - match data { - Some(map) => { - if let Some(val) = map.get("hash") { - Ok(val.as_int().unwrap_or(0)) - } else { - Err(RuntimeException { - message: format!("Failed unpacking: {}", joined), - code: 0, - } - .into()) - } - } + match binary.get(..4) { + Some(chunk) => Ok(i32::from_ne_bytes(chunk.try_into().unwrap()) as i64), None => Err(RuntimeException { message: format!("Failed unpacking: {}", joined), code: 0, -- cgit v1.3.1