From 173227dd538a8e68cac7df68de8d702047856c9f Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 5 Nov 2009 17:50:37 +0000 Subject: [PATCH] Added SetIndexAt(), replacing an existing index. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33906 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/types/ArrayIndexPath.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/types/ArrayIndexPath.h b/src/apps/debugger/types/ArrayIndexPath.h index a0e48aaf10..834444e3da 100644 --- a/src/apps/debugger/types/ArrayIndexPath.h +++ b/src/apps/debugger/types/ArrayIndexPath.h @@ -27,7 +27,7 @@ public: inline int32 CountIndices() const; inline int64 IndexAt(int32 index) const; inline bool AddIndex(int64 index); - + inline void SetIndexAt(int32 at, int64 newIndex); ArrayIndexPath& operator=(const ArrayIndexPath& other); @@ -61,4 +61,12 @@ ArrayIndexPath::AddIndex(int64 index) } +void +ArrayIndexPath::SetIndexAt(int32 at, int64 newIndex) +{ + if (at >= 0 && at < fIndices.Count()) + fIndices[at] = newIndex; +} + + #endif // ARRAY_INDEX_PATH_H