Commit 12b9159e authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Simplify DocumentStyleEnvironmentVariables::GenerateHashFromName

Use the StringHasher::ComputeHash() helper.

Change-Id: Ic43c19467a9d15f1b82c4ac586ebe7b80f937c60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762220Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#688709}
parent a5c811fb
......@@ -15,17 +15,9 @@ namespace blink {
// static
unsigned DocumentStyleEnvironmentVariables::GenerateHashFromName(
const AtomicString& name) {
StringHasher hasher;
if (name.Is8Bit()) {
String name_str = String(name);
name_str.Ensure16Bit();
hasher.AddCharacters(name_str.Characters16(), name_str.length());
} else {
hasher.AddCharacters(name.Characters16(), name.length());
}
return hasher.GetHash();
if (name.Is8Bit())
return StringHasher::ComputeHash(name.Characters8(), name.length());
return StringHasher::ComputeHash(name.Characters16(), name.length());
}
// static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment