Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistBaseXHPASTLinter.php
| Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | /* -( Sharing Parse Trees )------------------------------------------------ */ | ||||
| * @task sharing | * @task sharing | ||||
| */ | */ | ||||
| final protected function releaseSharedFutures(array $paths) { | final protected function releaseSharedFutures(array $paths) { | ||||
| foreach ($paths as $path) { | foreach ($paths as $path) { | ||||
| if (empty($this->refcount[$path])) { | if (empty($this->refcount[$path])) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Imbalanced calls to shared futures: each call to '. | 'Imbalanced calls to shared futures: each call to '. | ||||
| 'buildSharedFutures() for a path must be paired with a call to '. | '%s for a path must be paired with a call to %s.', | ||||
| 'releaseSharedFutures().')); | 'buildSharedFutures()', | ||||
| 'releaseSharedFutures()')); | |||||
| } | } | ||||
| $this->refcount[$path]--; | $this->refcount[$path]--; | ||||
| if (!$this->refcount[$path]) { | if (!$this->refcount[$path]) { | ||||
| unset($this->refcount[$path]); | unset($this->refcount[$path]); | ||||
| unset($this->futures[$path]); | unset($this->futures[$path]); | ||||
| unset($this->trees[$path]); | unset($this->trees[$path]); | ||||
| ▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines | |||||