3rd Repo, trying to figure this out.
Fork of SOFT253_Template_Weather_OS_54 by
Diff: CircularArray/CircularArray.cpp
- Revision:
- 72:ef4a4e3089c1
- Parent:
- 71:a935e4b88ad8
- Child:
- 74:749727490f44
diff -r a935e4b88ad8 -r ef4a4e3089c1 CircularArray/CircularArray.cpp --- a/CircularArray/CircularArray.cpp Fri Apr 21 18:32:12 2017 +0000 +++ b/CircularArray/CircularArray.cpp Fri Apr 21 18:49:48 2017 +0000 @@ -18,8 +18,8 @@ firstValue++; currentSize--; } - int nextSpace = nextSpace(); - array[nextSpace] = _measure; + int next = nextSpace(); + array[next] = _measure; currentSize++; } void CircularArray::readX(int x) @@ -57,10 +57,6 @@ firstValue += x; currentSize -= x; firstValue = firstValue % maxSize; - if(currentSize <= 0) - { - deleteAll(); - } } } void CircularArray::deleteAll()