Skip to content

Commit

Permalink
@saveman71 comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Neamar authored Feb 16, 2017
1 parent 0786270 commit 2a6a5c4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/src/main/java/fr/neamar/kiss/pojo/AppPojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public class AppPojo extends Pojo {


public void setTags(String tags) {
// Set the actual user-friendly name
// Set the actual user-friendly name
this.tags = tags;

if (tags != null) {
if (this.tags != null) {
this.tags = this.tags.replaceAll("<", "&lt;");
// Normalize name for faster searching
Pair<String, int[]> normalized = StringNormalizer.normalizeWithMap(this.tags);
Expand All @@ -37,11 +37,9 @@ public void setTagHighlight(int positionStart, int positionEnd) {
int posEnd = this.mapTagsPosition(positionEnd);

this.displayTags = this.tags.substring(0, posStart)
+ '{' + this.tags.substring(posStart, posEnd) + '}'+this.tags.substring(posEnd, this.tags.length());
+ '{' + this.tags.substring(posStart, posEnd) + '}' + this.tags.substring(posEnd, this.tags.length());
}



/**
* Map a position in the normalized name to a position in the standard name string
*
Expand All @@ -52,16 +50,14 @@ public int mapTagsPosition(int position) {
if (this.tagsPositionMap != null) {
if (position < this.tagsPositionMap.length) {
return this.tagsPositionMap[position];
} else {
return this.tags.length();
}
return this.tags.length();
} else {
// No mapping defined
if (position < this.tags.length()) {
return position;
} else {
return this.tags.length();
}
return this.tags.length();
}
}

Expand Down

0 comments on commit 2a6a5c4

Please sign in to comment.