no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / xpcom / ds / nsTObserverArray.cpp
blob68211873dd2798b47ea7e6cc5bff17bfb5fec017
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsTObserverArray.h"
9 void nsTObserverArray_base::AdjustIterators(index_type aModPos,
10 diff_type aAdjustment) {
11 MOZ_ASSERT(aAdjustment == -1 || aAdjustment == 1, "invalid adjustment");
12 Iterator_base* iter = mIterators;
13 while (iter) {
14 if (iter->mPosition > aModPos) {
15 iter->mPosition += aAdjustment;
17 iter = iter->mNext;
21 void nsTObserverArray_base::ClearIterators() {
22 Iterator_base* iter = mIterators;
23 while (iter) {
24 iter->mPosition = 0;
25 iter = iter->mNext;