Index: uspace/lib/cpp/include/internal/hash_table_iterators.hpp
===================================================================
--- uspace/lib/cpp/include/internal/hash_table_iterators.hpp	(revision 6b18e43969229aee425dc9cc96cc33dfed7e42f7)
+++ uspace/lib/cpp/include/internal/hash_table_iterators.hpp	(revision f63bef0f0d20ab7b382d0966e85fe7ea0e50777b)
@@ -91,7 +91,79 @@
             hash_table_const_iterator operator++(int)
             {
-                auto tmp_current = current_;
-                auto tmp_idx = idx_;
-
+                auto tmp = *this;
+                ++(*this);
+
+                return tmp;
+            }
+
+            list_node<value_type>* node()
+            {
+                return const_cast<list_node<value_type>*>(current_);
+            }
+
+            const list_node<value_type>* node() const
+            {
+                return current_;
+            }
+
+            size_type idx() const
+            {
+                return idx_;
+            }
+
+        private:
+            const hash_table_bucket<value_type, size_type>* table_;
+            size_type idx_;
+            size_type max_idx_;
+            const list_node<value_type>* current_;
+    };
+
+    template<class Value, class ConstRef, class ConstPtr, class Size>
+    bool operator==(const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& lhs,
+                    const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& rhs)
+    {
+        return lhs.node() == rhs.node();
+    }
+
+    template<class Value, class ConstRef, class ConstPtr, class Size>
+    bool operator!=(const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& lhs,
+                    const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& rhs)
+    {
+        return !(lhs == rhs);
+    }
+
+    template<class Value, class Reference, class Pointer, class Size>
+    class hash_table_iterator
+    {
+        public:
+            using value_type      = Value;
+            using size_type       = Size;
+            using reference       = Reference;
+            using pointer         = Pointer;
+            using difference_type = ptrdiff_t;
+
+            using iterator_category = forward_iterator_tag;
+
+            hash_table_iterator(hash_table_bucket<value_type, size_type>* table = nullptr,
+                                size_type idx = size_type{}, size_type max_idx = size_type{},
+                                list_node<value_type>* current = nullptr)
+                : table_{table}, idx_{idx}, max_idx_{max_idx}, current_{current}
+            { /* DUMMY BODY */ }
+
+            hash_table_iterator(const hash_table_iterator&) = default;
+            hash_table_iterator& operator=(const hash_table_iterator&) = default;
+
+            reference operator*()
+            {
+                return current_->value;
+            }
+
+            pointer operator->()
+            {
+                return &current_->value;
+            }
+
+            hash_table_iterator& operator++()
+            {
                 current_ = current_->next;
                 if (current_ == table_[idx_].head)
@@ -111,95 +183,4 @@
                 }
 
-                return hash_table_const_iterator{
-                    table_, tmp_idx, max_idx_, tmp_current
-                };
-            }
-
-            list_node<value_type>* node()
-            {
-                return const_cast<list_node<value_type>*>(current_);
-            }
-
-            const list_node<value_type>* node() const
-            {
-                return current_;
-            }
-
-            size_type idx() const
-            {
-                return idx_;
-            }
-
-        private:
-            const hash_table_bucket<value_type, size_type>* table_;
-            size_type idx_;
-            size_type max_idx_;
-            const list_node<value_type>* current_;
-    };
-
-    template<class Value, class ConstRef, class ConstPtr, class Size>
-    bool operator==(const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& lhs,
-                    const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& rhs)
-    {
-        return lhs.node() == rhs.node();
-    }
-
-    template<class Value, class ConstRef, class ConstPtr, class Size>
-    bool operator!=(const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& lhs,
-                    const hash_table_const_iterator<Value, ConstRef, ConstPtr, Size>& rhs)
-    {
-        return !(lhs == rhs);
-    }
-
-    template<class Value, class Reference, class Pointer, class Size>
-    class hash_table_iterator
-    {
-        public:
-            using value_type      = Value;
-            using size_type       = Size;
-            using reference       = Reference;
-            using pointer         = Pointer;
-            using difference_type = ptrdiff_t;
-
-            using iterator_category = forward_iterator_tag;
-
-            hash_table_iterator(hash_table_bucket<value_type, size_type>* table = nullptr,
-                                size_type idx = size_type{}, size_type max_idx = size_type{},
-                                list_node<value_type>* current = nullptr)
-                : table_{table}, idx_{idx}, max_idx_{max_idx}, current_{current}
-            { /* DUMMY BODY */ }
-
-            hash_table_iterator(const hash_table_iterator&) = default;
-            hash_table_iterator& operator=(const hash_table_iterator&) = default;
-
-            reference operator*()
-            {
-                return current_->value;
-            }
-
-            pointer operator->()
-            {
-                return &current_->value;
-            }
-
-            hash_table_iterator& operator++()
-            {
-                current_ = current_->next;
-                if (current_ == table_[idx_].head)
-                {
-                    if (idx_ < max_idx_)
-                    {
-                        while (!table_[++idx_].head && idx_ < max_idx_)
-                        { /* DUMMY BODY */ }
-
-                        if (idx_ < max_idx_)
-                            current_ = table_[idx_].head;
-                        else
-                            current_ = nullptr;
-                    }
-                    else
-                        current_ = nullptr;
-                }
-
                 return *this;
             }
@@ -207,27 +188,8 @@
             hash_table_iterator operator++(int)
             {
-                auto tmp_current = current_;
-                auto tmp_idx = idx_;
-
-                current_ = current_->next;
-                if (current_ == table_[idx_].head)
-                {
-                    if (idx_ < max_idx_)
-                    {
-                        while (!table_[++idx_].head && idx_ < max_idx_)
-                        { /* DUMMY BODY */ }
-
-                        if (idx_ < max_idx_)
-                            current_ = table_[idx_].head;
-                        else
-                            current_ = nullptr;
-                    }
-                    else
-                        current_ = nullptr;
-                }
-
-                return hash_table_iterator{
-                    table_, tmp_idx, max_idx_, tmp_current
-                };
+                auto tmp = *this;
+                ++(*this);
+
+                return tmp;
             }
 
@@ -319,10 +281,8 @@
             hash_table_const_local_iterator operator++(int)
             {
-                auto tmp = current_;
-                current_ = current_->next;
-                if (current_ == head_)
-                    current_ = nullptr;
-
-                return hash_table_const_local_iterator{head_, tmp};
+                auto tmp = *this;
+                ++(*this);
+
+                return tmp;
             }
 
@@ -397,10 +357,8 @@
             hash_table_local_iterator operator++(int)
             {
-                auto tmp = current_;
-                current_ = current_->next;
-                if (current_ == head_)
-                    current_ = nullptr;
-
-                return hash_table_local_iterator{head_, tmp};
+                auto tmp = *this;
+                ++(*this);
+
+                return tmp;
             }
 
