git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH 1/1] Micro optimise getting ignored status of a resource

From
Ferry Huberts <ferry.huberts@pelagic.nl>
Date
May 3, 2009, 08:41 UTC
Message-ID
<9850c6445ac62a8ed8c76282b07f8a2cf8064e8f.1241339812.git.ferry.huberts@pelagic.nl>

Do not evaluate getting the ignored status of a resource twice when once is enough.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
---
 .../org/spearce/egit/core/op/TrackOperation.java   |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
index 29b4344..5f80698 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
@@ -94,14 +94,15 @@ public boolean visit(IResource resource) throws CoreException {
 									// first. If a resource within a ignored folder is marked
 									// we ignore it here, i.e. there is no way to unmark it expect
 									// by explicitly selecting and invoking track on it.
+									boolean isIgnored = Team.isIgnoredHint(resource);
 									if (resource.getType() == IResource.FILE) {
 										Entry entry = index.getEntry(repoPath);
-										if (!Team.isIgnoredHint(resource) || entry != null && entry.isAssumedValid()) {
+										if (!isIgnored || entry != null && entry.isAssumedValid()) {
 											entry = index.add(rm.getWorkDir(), new File(rm.getWorkDir(), repoPath));
 											entry.setAssumeValid(false);
 										}
 									}
-									if (Team.isIgnoredHint(resource))
+									if (isIgnored)
 										return false;
 
 								} catch (IOException e) {
-- 
1.6.0.6
Message 1 of 1 in “Micro optimise getting ignored status of a resource”
  1. 1/1 Micro optimise getting ignored status of a resourceFerry Huberts, May 3, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.