Conform more of the codebase to strictNullChecks (#10738)

This commit is contained in:
Michael Telatynski
2023-05-09 18:24:40 +01:00
committed by GitHub
parent 5e8488c283
commit 52017f62e1
18 changed files with 105 additions and 84 deletions

View File

@@ -77,12 +77,11 @@ export function formatCryptoKey(key: string): string {
*/
export function hashCode(str: string): number {
let hash = 0;
let i;
let chr;
let chr: number;
if (str.length === 0) {
return hash;
}
for (i = 0; i < str.length; i++) {
for (let i = 0; i < str.length; i++) {
chr = str.charCodeAt(i);
hash = (hash << 5) - hash + chr;
hash |= 0;