From 5431f2f774211ea8e6ad16afe3544f5ca1ce8789 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Sun, 10 Jan 2021 15:20:16 +0200 Subject: [PATCH] Make TimSort::gallop* static These member functions do not use data members and don't need a pointer to a TimSort object. --- include/gfx/timsort.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/gfx/timsort.hpp b/include/gfx/timsort.hpp index fa2b462..5eb1c41 100644 --- a/include/gfx/timsort.hpp +++ b/include/gfx/timsort.hpp @@ -264,7 +264,8 @@ template class TimSort { } template - diff_t gallopLeft(ref_t key, Iter const base, diff_t const len, diff_t const hint, Compare compare) { + static diff_t gallopLeft(ref_t key, Iter const base, diff_t const len, + diff_t const hint, Compare compare) { GFX_TIMSORT_ASSERT(len > 0); GFX_TIMSORT_ASSERT(hint >= 0); GFX_TIMSORT_ASSERT(hint < len); @@ -314,7 +315,8 @@ template class TimSort { } template - diff_t gallopRight(ref_t key, Iter const base, diff_t const len, diff_t const hint, Compare compare) { + static diff_t gallopRight(ref_t key, Iter const base, diff_t const len, + diff_t const hint, Compare compare) { GFX_TIMSORT_ASSERT(len > 0); GFX_TIMSORT_ASSERT(hint >= 0); GFX_TIMSORT_ASSERT(hint < len);