summaryrefslogtreecommitdiff
path: root/16.c
diff options
context:
space:
mode:
Diffstat (limited to '16.c')
-rw-r--r--16.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/16.c b/16.c
index 15e9671..bb565bf 100644
--- a/16.c
+++ b/16.c
@@ -34,6 +34,16 @@ qreverse(void * base, size_t nmemb, size_t size)
if (nmemb < 2)
return;
+#if 0 // This goes slower?!?
+ if (nmemb < BUFSIZ / size) {
+ char tmp[nmemb * size];
+ memcpy(tmp, base, nmemb * size);
+ for (i = 0; i < nmemb; ++i)
+ memcpy(base + i * size, tmp + (nmemb - 1 - i) * size, size);
+ return;
+ }
+#endif
+
for (i = 0, j = nmemb - 1; i < j; ++i, --j)
qswap(base, size, i, j);
}