diff data/model/EditableDenseThreeDimensionalModel.cpp @ 537:3cc4b7cd2aa5

* Merge from one-fftdataserver-per-fftmodel branch. This bit of reworking (which is not described very accurately by the title of the branch) turns the MatrixFile object into something that either reads or writes, but not both, and separates the FFT file cache reader and writer implementations separately. This allows the FFT data server to have a single thread owning writers and one reader per "customer" thread, and for all locking to be vastly simplified and concentrated in the data server alone (because none of the classes it makes use of is used in more than one thread at a time). The result is faster and more trustworthy code.
author Chris Cannam
date Tue, 27 Jan 2009 13:25:10 +0000
parents beb51f558e9c
children 4f3e3fb07e0b
line wrap: on
line diff
--- a/data/model/EditableDenseThreeDimensionalModel.cpp	Mon Jan 26 15:18:32 2009 +0000
+++ b/data/model/EditableDenseThreeDimensionalModel.cpp	Tue Jan 27 13:25:10 2009 +0000
@@ -291,15 +291,16 @@
     int tdist = trunc;
     if (trunc < 0) { top = false; tdist = -trunc; }
     Column p = expandAndRetrieve(index - tdist);
-    if (p.size() != m_yBinCount) {
+    int psize = p.size(), csize = c.size();
+    if (psize != m_yBinCount) {
         std::cerr << "WARNING: EditableDenseThreeDimensionalModel::expandAndRetrieve: Trying to expand from incorrectly sized column" << std::endl;
     }
     if (top) {
-        for (int i = c.size(); i < p.size(); ++i) {
+        for (int i = csize; i < psize; ++i) {
             c.push_back(p.at(i));
         }
     } else {
-        for (int i = int(p.size()) - int(c.size()); i >= 0; --i) {
+        for (int i = psize - csize - 1; i >= 0; --i) {
             c.push_front(p.at(i));
         }
     }