| Author | Dave Jarvis <email> |
|---|---|
| Date | 2026-02-21 21:14:58 GMT-0800 |
| Commit | 46a28e15a545fc202f20f230a28dab4ffe83217e |
| Parent | c010121 |
| } | ||
| + public function computeIntDedicated( callable $callback, int $default ): int { | ||
| + return $this->manager->computeIntDedicated( | ||
| + $this->packFile, | ||
| + function( StreamReader $stream ) use ( $callback ): int { | ||
| + return $callback( $stream, $this->offset ); | ||
| + }, | ||
| + $default | ||
| + ); | ||
| + } | ||
| + | ||
| public function computeStringDedicated( | ||
| callable $callback, |
| public function getSize( PackContext $context ): int { | ||
| - return $context->computeInt( | ||
| + return $context->computeIntDedicated( | ||
| function( StreamReader $stream, int $offset ): int { | ||
| $stream->seek( $offset ); |
| } | ||
| + public function computeIntDedicated( | ||
| + string $path, | ||
| + callable $callback, | ||
| + int $default | ||
| + ): int { | ||
| + $result = $default; | ||
| + $reader = BufferedReader::open( $path ); | ||
| + | ||
| + if( $reader->isOpen() ) { | ||
| + $result = $callback( $reader ); | ||
| + } | ||
| + | ||
| + return $result; | ||
| + } | ||
| + | ||
| public function computeStringDedicated( | ||
| string $path, |
| Delta | 26 lines added, 1 line removed, 25-line increase |
|---|