Title: [261073] trunk/Source/WTF
Revision
261073
Author
[email protected]
Date
2020-05-04 00:13:21 -0700 (Mon, 04 May 2020)

Log Message

Remove some unused and broken functions in Bitmap.
https://bugs.webkit.org/show_bug.cgi?id=211368

Reviewed by Yusuke Suzuki.

Bitmap::operator[] never worked.  There's currently no way to use it to read a
bit value.  We also can't use it to set a bit value because it relies on
Bitmap::iterator::operator= to set the value.  However, Bitmap::iterator stores
the Bitmap* as a const pointer, and Bitmap::iterator::operator= calls set() on
the const pointer.  If we try to use operator[] to set a bit, we'll get a
compilation error.

This patch removes the 2 variants of Bitmap::operator[] and Bitmap::iterator::operator=.

* wtf/Bitmap.h:
(WTF::WordType>::operator): Deleted.
(WTF::WordType>::operator const const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (261072 => 261073)


--- trunk/Source/WTF/ChangeLog	2020-05-04 07:07:32 UTC (rev 261072)
+++ trunk/Source/WTF/ChangeLog	2020-05-04 07:13:21 UTC (rev 261073)
@@ -1,3 +1,23 @@
+2020-05-03  Mark Lam  <[email protected]>
+
+        Remove some unused and broken functions in Bitmap.
+        https://bugs.webkit.org/show_bug.cgi?id=211368
+
+        Reviewed by Yusuke Suzuki.
+
+        Bitmap::operator[] never worked.  There's currently no way to use it to read a
+        bit value.  We also can't use it to set a bit value because it relies on
+        Bitmap::iterator::operator= to set the value.  However, Bitmap::iterator stores
+        the Bitmap* as a const pointer, and Bitmap::iterator::operator= calls set() on
+        the const pointer.  If we try to use operator[] to set a bit, we'll get a
+        compilation error.
+
+        This patch removes the 2 variants of Bitmap::operator[] and Bitmap::iterator::operator=.
+
+        * wtf/Bitmap.h:
+        (WTF::WordType>::operator): Deleted.
+        (WTF::WordType>::operator const const): Deleted.
+
 2020-05-03  Rob Buis  <[email protected]>
 
         atob() should not accept a vertical tab

Modified: trunk/Source/WTF/wtf/Bitmap.h (261072 => 261073)


--- trunk/Source/WTF/wtf/Bitmap.h	2020-05-04 07:07:32 UTC (rev 261072)
+++ trunk/Source/WTF/wtf/Bitmap.h	2020-05-04 07:13:21 UTC (rev 261073)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2010-2019 Apple Inc. All rights reserved.
+ *  Copyright (C) 2010-2020 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -103,12 +103,6 @@
             return !(*this == other);
         }
 
-        iterator& operator=(bool value)
-        {
-            m_bitmap->set(m_index, value);
-            return *this;
-        }
-
     private:
         const Bitmap* m_bitmap;
         size_t m_index;
@@ -118,9 +112,6 @@
     iterator begin() const { return iterator(*this, findBit(0, true)); }
     iterator end() const { return iterator(*this, bitmapSize); }
     
-    iterator operator[](size_t);
-    const iterator operator[](size_t) const;
-
     void mergeAndClear(Bitmap&);
     void setAndClear(Bitmap&);
     
@@ -427,19 +418,6 @@
 }
 
 template<size_t bitmapSize, typename WordType>
-inline auto Bitmap<bitmapSize, WordType>::operator[](size_t index) -> iterator
-{
-    ASSERT(index < size());
-    return iterator(*this, index);
-}
-
-template<size_t bitmapSize, typename WordType>
-inline auto Bitmap<bitmapSize, WordType>::operator[](size_t index) const -> const iterator
-{
-    return (*const_cast<Bitmap<bitmapSize, WordType>*>(this))[index];
-}
-
-template<size_t bitmapSize, typename WordType>
 inline unsigned Bitmap<bitmapSize, WordType>::hash() const
 {
     unsigned result = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to