michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsTObserverArray.h" michael@0: michael@0: void michael@0: nsTObserverArray_base::AdjustIterators(index_type aModPos, michael@0: diff_type aAdjustment) michael@0: { michael@0: NS_PRECONDITION(aAdjustment == -1 || aAdjustment == 1, michael@0: "invalid adjustment"); michael@0: Iterator_base* iter = mIterators; michael@0: while (iter) { michael@0: if (iter->mPosition > aModPos) { michael@0: iter->mPosition += aAdjustment; michael@0: } michael@0: iter = iter->mNext; michael@0: } michael@0: } michael@0: michael@0: void michael@0: nsTObserverArray_base::ClearIterators() michael@0: { michael@0: Iterator_base* iter = mIterators; michael@0: while (iter) { michael@0: iter->mPosition = 0; michael@0: iter = iter->mNext; michael@0: } michael@0: }