Skip to content

Commit b4476cf

Browse files
Got rid of compareStrings()
Why? Just why do you want that function?
1 parent b69ea1e commit b4476cf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

card.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
continue;
4242
}
4343
for (let j = 0; j < reposData.length; j++) {
44-
if (compareStrings(this.repos[i], reposData[j].name)) {
44+
if (this.repos[i].toLowerCase().trim() === reposData[j].name.toLowerCase().trim()) {
4545
var div = document.createElement('div');
4646
div.id = 'github-card-repo' + (i + 1);
4747
div.innerHTML = "<a class='github-card-repo-headline' href=" + reposData[j].html_url + "><b>" + reposData[j].name + "</b></a><br><span class='github-card-repo-desc'>" + reposData[j].description + "</span><br><span style='font-size:8pt;'>&#9733;" + reposData[j].language + "</span>";
@@ -93,12 +93,6 @@
9393
}
9494
}
9595

96-
function compareStrings(string1, string2) {
97-
string1 = string1.toLowerCase().trim();
98-
string2 = string2.toLowerCase().trim();
99-
return string1 === string2;
100-
}
101-
10296
window.onload = function() {
10397
let link = document.createElement('link');
10498
link.rel = 'stylesheet';

0 commit comments

Comments
 (0)