Skip to content
Permalink
Browse files
Merge pull request #1143 from christ66/JENKINS-21969
[FIXED JENKINS-21969] Performance issue with search box
  • Loading branch information
christ66 committed Mar 11, 2014
2 parents 99e080f + ae5a3cb commit a4c4ed5fdabaae6c734545fc6a548e1ed9c3267c
@@ -378,7 +378,10 @@ private static User getOrCreate(String id, String fullName, boolean create) {
Authentication a = Jenkins.getAuthentication();
if(a instanceof AnonymousAuthenticationToken)
return null;
return get(a.getName());

// Since we already know this is a name, we can just call getOrCreate with the name directly.
String id = a.getName();
return getOrCreate(id, id, true);
}

private static volatile long lastScanned;
@@ -52,13 +52,14 @@ public void find(String token, List<SearchItem> result) {

public void suggest(String token, List<SearchItem> result) {
Collection<SMT> items = all();
if(UserSearchProperty.isCaseInsensitive()){
boolean isCaseSensitive = UserSearchProperty.isCaseInsensitive();
if(isCaseSensitive){
token = token.toLowerCase();
}
if(items==null) return;
for (SMT o : items) {
String name = getName(o);
if(UserSearchProperty.isCaseInsensitive())
if(isCaseSensitive)
name=name.toLowerCase();
if(o!=null && name.contains(token))
result.add(o);

0 comments on commit a4c4ed5

Please sign in to comment.