Have utilStringQs advance past any leading '?' or '#' characters

This lets us remove a bunch of substring(1) and +1 from the code.
This commit is contained in:
Bryan Housel
2020-02-20 17:09:54 -05:00
parent 1f4fe57d8b
commit dc7fba4bf8
10 changed files with 61 additions and 38 deletions
+4
View File
@@ -318,6 +318,10 @@ export function utilCombinedTags(entityIDs, graph) {
export function utilStringQs(str) {
var i = 0; // advance past any leading '?' or '#' characters
while (i < str.length && (str[i] === '?' || str[i] === '#')) i++;
str = str.slice(i);
return str.split('&').reduce(function(obj, pair){
var parts = pair.split('=');
if (parts.length === 2) {