From 6a31d6ebb47f310b2039dcd69085bba1583e3159 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 11 Feb 2014 13:31:27 +0100 Subject: [PATCH] minor simplification --- core/src/main/java/hudson/Functions.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index daf88e9000..3736611bf8 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -1005,19 +1005,13 @@ public class Functions { Item i=p; String url = ""; - Collection viewItems; - if (view != null) { - viewItems = view.getItems(); - } else { - viewItems = Collections.emptyList(); - } while(true) { ItemGroup ig = i.getParent(); url = i.getShortUrl()+url; if(ig== Jenkins.getInstance() || (view != null && ig == view.getOwnerItemGroup())) { assert i instanceof TopLevelItem; - if(viewItems.contains((TopLevelItem)i)) { + if (view.contains((TopLevelItem)i)) { // if p and the current page belongs to the same view, then return a relative path return normalizeURI(ancestors.get(view)+'/'+url); } else { -- GitLab