aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-02 05:56:56 +0900
committernsfisis <nsfisis@gmail.com>2026-08-02 05:56:56 +0900
commit4fa973840f0a0e2cbb16f5e3341c0625793af2ed (patch)
tree6fcf9342ad97302fcb065e642309b6ccf81fe87c /crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs
parent73911c5da18cd37761f90a15558d76d5742f38e5 (diff)
downloadphp-shirabe-4fa973840f0a0e2cbb16f5e3341c0625793af2ed.tar.gz
php-shirabe-4fa973840f0a0e2cbb16f5e3341c0625793af2ed.tar.zst
php-shirabe-4fa973840f0a0e2cbb16f5e3341c0625793af2ed.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs')
-rw-r--r--crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs15
1 files changed, 2 insertions, 13 deletions
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,