aboutsummaryrefslogtreecommitdiff
path: root/include/olm/list.hh
diff options
context:
space:
mode:
Diffstat (limited to 'include/olm/list.hh')
-rw-r--r--include/olm/list.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/olm/list.hh b/include/olm/list.hh
index e4bf951..6906c87 100644
--- a/include/olm/list.hh
+++ b/include/olm/list.hh
@@ -69,10 +69,10 @@ public:
} else if (pos == _end) {
--pos;
}
- T * tmp = pos;
- while (tmp != _end - 1) {
- *(tmp + 1) = *tmp;
- ++tmp;
+ T * tmp = _end - 1;
+ while (tmp != pos) {
+ *tmp = *(tmp - 1);
+ --tmp;
}
return pos;
}