Changeset 261073 in webkit
- Timestamp:
- May 4, 2020, 12:13:21 AM (5 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r261061 r261073 1 2020-05-03 Mark Lam <mark.lam@apple.com> 2 3 Remove some unused and broken functions in Bitmap. 4 https://bugs.webkit.org/show_bug.cgi?id=211368 5 6 Reviewed by Yusuke Suzuki. 7 8 Bitmap::operator[] never worked. There's currently no way to use it to read a 9 bit value. We also can't use it to set a bit value because it relies on 10 Bitmap::iterator::operator= to set the value. However, Bitmap::iterator stores 11 the Bitmap* as a const pointer, and Bitmap::iterator::operator= calls set() on 12 the const pointer. If we try to use operator[] to set a bit, we'll get a 13 compilation error. 14 15 This patch removes the 2 variants of Bitmap::operator[] and Bitmap::iterator::operator=. 16 17 * wtf/Bitmap.h: 18 (WTF::WordType>::operator): Deleted. 19 (WTF::WordType>::operator const const): Deleted. 20 1 21 2020-05-03 Rob Buis <rbuis@igalia.com> 2 22 -
trunk/Source/WTF/wtf/Bitmap.h
r261055 r261073 1 1 /* 2 * Copyright (C) 2010-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 104 104 } 105 105 106 iterator& operator=(bool value)107 {108 m_bitmap->set(m_index, value);109 return *this;110 }111 112 106 private: 113 107 const Bitmap* m_bitmap; … … 119 113 iterator end() const { return iterator(*this, bitmapSize); } 120 114 121 iterator operator[](size_t);122 const iterator operator[](size_t) const;123 124 115 void mergeAndClear(Bitmap&); 125 116 void setAndClear(Bitmap&); … … 428 419 429 420 template<size_t bitmapSize, typename WordType> 430 inline auto Bitmap<bitmapSize, WordType>::operator[](size_t index) -> iterator431 {432 ASSERT(index < size());433 return iterator(*this, index);434 }435 436 template<size_t bitmapSize, typename WordType>437 inline auto Bitmap<bitmapSize, WordType>::operator[](size_t index) const -> const iterator438 {439 return (*const_cast<Bitmap<bitmapSize, WordType>*>(this))[index];440 }441 442 template<size_t bitmapSize, typename WordType>443 421 inline unsigned Bitmap<bitmapSize, WordType>::hash() const 444 422 {
Note:
See TracChangeset
for help on using the changeset viewer.