Project

General

Profile

Actions

Bug #19467

closed

Inefficient comparision of strings in Rudder

Added by Nicolas CHARLES almost 3 years ago. Updated almost 3 years ago.

Status:
Released
Priority:
N/A
Category:
Performance and scalability
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

We are sometimes doing

    val lower = s.toLowerCase
    for(comp <- comparators) {
      if(lower == comp.id.toLowerCase)

rather than

for(comp <- comparators) {
if(name.equalsIgnoreCase(c.name)) 

it's not that bad, but toLowerCase creates a new object (and toLowerCase or toUpperCase may have unpredictable results for some alphabets)

Actions

Also available in: Atom PDF