Page MenuHomePhabricator

D12520.diff
No OneTemporary

D12520.diff

diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php
--- a/src/lint/linter/ArcanistLinter.php
+++ b/src/lint/linter/ArcanistLinter.php
@@ -16,8 +16,9 @@
const GRANULARITY_GLOBAL = 4;
private $id;
- protected $paths = array();
- protected $data = array();
+ protected $paths = array();
+ private $filteredPaths = null;
+ protected $data = array();
protected $engine;
protected $activePath;
protected $messages = array();
@@ -274,19 +275,24 @@
final public function addPath($path) {
$this->paths[$path] = $path;
+ $this->filteredPaths = null;
return $this;
}
final public function setPaths(array $paths) {
$this->paths = $paths;
+ $this->filteredPaths = null;
return $this;
}
/**
* Filter out paths which this linter doesn't act on (for example, because
* they are binaries and the linter doesn't apply to binaries).
+ *
+ * @param list<string>
+ * @return list<string>
*/
- final private function filterPaths($paths) {
+ final private function filterPaths(array $paths) {
$engine = $this->getEngine();
$keep = array();
@@ -314,7 +320,11 @@
}
final public function getPaths() {
- return $this->filterPaths(array_values($this->paths));
+ if ($this->filteredPaths === null) {
+ $this->filteredPaths = $this->filterPaths(array_values($this->paths));
+ }
+
+ return $this->filteredPaths;
}
final public function addData($path, $data) {

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 4:12 AM (20 h, 32 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6791875
Default Alt Text
D12520.diff (1 KB)

Event Timeline