Fix for 'Remove All entries from this domain' on history item#1605
Fix for 'Remove All entries from this domain' on history item#1605fnkkio wants to merge 1 commit into
Conversation
|
I'm not sure what should be the proper approach here, one thing is for sure, |
|
I revised my previous commit and came up with a better solution. |
| return {}; | ||
| } | ||
|
|
||
| const int domainStartIdx = host.lastIndexOf('.', (-1 * tld.size()) - 1) + 1; |
There was a problem hiding this comment.
'+1' at the end because:
- in case lastIndexOf does not find a dot, it will return -1, adding 1 will set the domainStartIdx to 0
- in case lastIndexOf does find a dot, it should return the idx after the dot
ie.
220.ro -> lastIndexOf returns -1, we add 1, domainStartIdx = 0, return value = 220.ro
vid.220.ro -> lastIndexOf returns 3, we add 1, domainStartIdx = 4, return value = 220.ro
|
@Emdek Do you think this is the right approach ? (In the latest version of this PR I am removing history items for the domain and all its subdomains) |
Fixes #1604