~sircmpwn/himitsu-devel

himitsu: himitsu::query: Use sort::cmp::strs v1 APPLIED

Alexey Yerin: 1
 himitsu::query: Use sort::cmp::strs

 1 files changed, 2 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/himitsu-devel/patches/47198/mbox | git am -3
Learn more about email & git

[PATCH himitsu] himitsu::query: Use sort::cmp::strs Export this patch

---
 himitsu/query/parse.ha | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/himitsu/query/parse.ha b/himitsu/query/parse.ha
index 2a91849..74aa3e5 100644
--- a/himitsu/query/parse.ha
+++ b/himitsu/query/parse.ha
@@ -4,6 +4,7 @@ use encoding::utf8;
use io;
use regex;
use shlex;
use sort::cmp;
use sort::{sort};
use strings;
use fmt;
@@ -112,7 +113,7 @@ export fn parse_items(items: []str) (query | error) = {
	};

	// check dupes
	sort(keys, size(str), &cmpkeys);
	sort(keys, size(str), &cmp::strs);
	let prev = keys[0];
	for (let i = 1z; i < len(keys); i += 1) {
		if (prev == keys[i]) {
@@ -125,9 +126,6 @@ export fn parse_items(items: []str) (query | error) = {
	return query;
};

fn cmpkeys(a: const *opaque, b: const *opaque) int =
	strings::compare(*(a: *str), *(b: *str));

// Duplicates a query, but only keeps values of public key/value pairs. The
// caller must pass the return value to [[finish]] after use.
export fn dup_pub(q: *query) query = {
-- 
2.43.0
Thanks!

To https://git.sr.ht/~sircmpwn/himitsu
   734a34b..c657d70  master -> master