Mercurial > hg > svcore
diff data/fileio/MatrixFile.cpp @ 1206:659372323b45 tony-2.0-integration
Merge latest SV 3.0 branch code
author | Chris Cannam |
---|---|
date | Fri, 19 Aug 2016 15:58:57 +0100 |
parents | aa588c391d1a |
children |
line wrap: on
line diff
--- a/data/fileio/MatrixFile.cpp Tue Oct 20 12:54:06 2015 +0100 +++ b/data/fileio/MatrixFile.cpp Fri Aug 19 15:58:57 2016 +0100 @@ -176,8 +176,6 @@ QMutexLocker locker(&m_createMutex); - delete m_setColumns; - if (m_fileName != "") { if (--m_refcount[m_fileName] == 0) { @@ -208,7 +206,7 @@ assert(m_mode == WriteOnly); - m_setColumns = new ResizeableBitset(m_width); + m_setColumns.resize(m_width, false); off_t off = m_headerSize + (m_width * m_height * m_cellSize) + m_width; @@ -316,7 +314,7 @@ MatrixFile::haveSetColumnAt(int x) const { if (m_mode == WriteOnly) { - return m_setColumns->get(x); + return m_setColumns[x]; } if (m_readyToReadColumn >= 0 && @@ -398,9 +396,10 @@ throw FileOperationFailed(m_fileName, "write"); } - m_setColumns->set(x); + m_setColumns[x] = true; if (m_autoClose) { - if (m_setColumns->isAllOn()) { + if (std::all_of(m_setColumns.begin(), m_setColumns.end(), + [](bool c) { return c; })) { #ifdef DEBUG_MATRIX_FILE cerr << "MatrixFile[" << m_fd << "]::setColumnAt(" << x << "): All columns set: auto-closing" << endl; #endif