From ccb63f1abbae18657708dd8ea38e0892aa0fc48a Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Fri, 12 Aug 2022 21:54:53 +0200 Subject: cstr V4: Changed cstr functions to take pointers to self, not values. This is consistent with the rest of the containers. csview will still use values, as it is designed to be passed by value. --- benchmarks/misc/string_bench_STC.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'benchmarks/misc/string_bench_STC.cpp') diff --git a/benchmarks/misc/string_bench_STC.cpp b/benchmarks/misc/string_bench_STC.cpp index 648cb1f3..065b6dd7 100644 --- a/benchmarks/misc/string_bench_STC.cpp +++ b/benchmarks/misc/string_bench_STC.cpp @@ -101,7 +101,7 @@ void initShortStringVec(cvec_str* vs, cvec_sv* vsv) c_foreach (i, cvec_str, *vs) { cvec_sv_push_back(vsv, cstr_sv(i.ref)); - num += cstr_size(*i.ref); + num += cstr_size(i.ref); } std::cout << "num strings: " << cvec_sv_size(vsv) << std::endl; std::cout << "avg str len: " << num / (float)cvec_sv_size(vsv) << std::endl; @@ -147,7 +147,7 @@ void initLongStringVec(cvec_str* vs, cvec_sv* vsv) c_foreach (i, cvec_str, *vs) { cvec_sv_push_back(vsv, cstr_sv(i.ref)); - num += cstr_size(*i.ref); + num += cstr_size(i.ref); } std::cout << "num strings: " << cvec_sv_size(vsv) << std::endl; std::cout << "avg str len: " << num / (float)cvec_sv_size(vsv) << std::endl; -- cgit v1.2.3