Skip to content

Instantly share code, notes, and snippets.

@ehsan
Created May 8, 2019 14:41
Show Gist options
  • Save ehsan/4ea97682f98d262e8f17220484f6f505 to your computer and use it in GitHub Desktop.
Save ehsan/4ea97682f98d262e8f17220484f6f505 to your computer and use it in GitHub Desktop.
diff --git a/image/ImageCacheKey.cpp b/image/ImageCacheKey.cpp
index 52bffcd409e3..091f83c795d4 100644
--- a/image/ImageCacheKey.cpp
+++ b/image/ImageCacheKey.cpp
@@ -123,7 +123,9 @@ void ImageCacheKey::EnsureHash() const {
// Since we frequently call Hash() several times in a row on the same
// ImageCacheKey, as an optimization we compute our hash once and store it.
- nsPrintfCString ptr("%p", mControlledDocument);
+ static uint32_t counter = 0;
+
+ nsPrintfCString ptr("%p%d", mControlledDocument, counter++);
nsAutoCString suffix;
mOriginAttributes.CreateSuffix(suffix);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment