summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydatapointer.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-02 02:17:14 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-17 00:11:12 +0200
commit5ea50054a18c07f86f61e95dad5bca41c521ad3d (patch)
tree8b5cfc98a614ba2653259438b54062f2fc8bc58b /src/corelib/tools/qarraydatapointer.h
parent8e82c30680b96ff0f95caa28517fa410cd6d291a (diff)
QArrayData: store the right flag type, not an int
There's no reason to be storing `int` in the array data header and then using it as a QFlags. Just store the QFlags. Change-Id: I78f489550d74d15a560dacf338110d80a7ddfdd2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qarraydatapointer.h')
-rw-r--r--src/corelib/tools/qarraydatapointer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index af60a105fec..c984989ac83 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -330,7 +330,7 @@ public:
bool isSharedWith(const QArrayDataPointer &other) const noexcept { return d && d == other.d; }
bool needsDetach() const noexcept { return !d || d->needsDetach(); }
qsizetype detachCapacity(qsizetype newSize) const noexcept { return d ? d->detachCapacity(newSize) : newSize; }
- const typename Data::ArrayOptions flags() const noexcept { return d ? typename Data::ArrayOption(d->flags) : Data::ArrayOptionDefault; }
+ const typename Data::ArrayOptions flags() const noexcept { return d ? d->flags : Data::ArrayOptionDefault; }
void setFlag(typename Data::ArrayOptions f) noexcept { Q_ASSERT(d); d->flags |= f; }
void clearFlag(typename Data::ArrayOptions f) noexcept { if (d) d->flags &= ~f; }