fix misuse of self implemented vector

Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
This commit is contained in:
侯红勋 2024-05-08 09:14:59 +08:00
parent 138b6b9490
commit acb5c5bed2
2 changed files with 68 additions and 2 deletions

View File

@ -0,0 +1,61 @@
From d685f09e034cc9632f3bdec89ba123f1e7c5e6fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= <houhongxun@kylinos.cn>
Date: Tue, 30 Apr 2024 10:51:38 +0800
Subject: [PATCH] fix incorrect use of locally implemented vector
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
---
libchinese-segmentation/cppjieba/DatTrie.hpp | 3 ++-
libchinese-segmentation/cppjieba/Unicode.hpp | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/libchinese-segmentation/cppjieba/DatTrie.hpp b/libchinese-segmentation/cppjieba/DatTrie.hpp
index 4904896..3d8ed44 100644
--- a/libchinese-segmentation/cppjieba/DatTrie.hpp
+++ b/libchinese-segmentation/cppjieba/DatTrie.hpp
@@ -7,6 +7,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <QDebug>
+#include <QVector>
#include <algorithm>
#include <utility>
@@ -92,7 +93,7 @@ inline std::ostream & operator << (std::ostream& os, const DatMemElem & elem) {
}
struct DatDag {
- limonp::LocalVector<pair<size_t, const DatMemElem *> > nexts;
+ QVector<pair<size_t, const DatMemElem *> > nexts;
double max_weight;
int max_next;
};
diff --git a/libchinese-segmentation/cppjieba/Unicode.hpp b/libchinese-segmentation/cppjieba/Unicode.hpp
index 360b461..69cea0a 100644
--- a/libchinese-segmentation/cppjieba/Unicode.hpp
+++ b/libchinese-segmentation/cppjieba/Unicode.hpp
@@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <ostream>
+#include <QVector>
#include "limonp/LocalVector.hpp"
#include "limonp/StringUtil.hpp"
@@ -58,8 +59,8 @@ inline std::ostream& operator << (std::ostream& os, const RuneInfo& r) {
return os << "{\"rune\": \"" << r.rune << "\", \"offset\": " << r.offset << ", \"len\": " << r.len << "}";
}
-typedef limonp::LocalVector<Rune> RuneArray;
-typedef limonp::LocalVector<struct RuneInfo> RuneStrArray;
+typedef QVector<Rune> RuneArray;
+typedef QVector<struct RuneInfo> RuneStrArray;
// [left, right]
struct WordRange {
--
2.43.0

View File

@ -1,11 +1,12 @@
Name: ukui-search
Version: 3.1
Release: 4
Release: 5
Summary: a user-wide desktop search feature of UKUI desktop environment
License: GPL-2.0-or-later and GPL-3.0-or-later and Apache-2.0
URL: http://www.ukui.org
Source0: %{name}-%{version}.tar.gz
Patch01: 0001-fix-coredump-of-ukui-search.patch
Patch02: 0001-fix-incorrect-use-of-locally-implemented-vector.patch
BuildRequires: pkgconf
BuildRequires: gsettings-qt-devel
@ -71,7 +72,8 @@ Summary: ukui-search-systemdbus is a systembus interface to modify max_user_wat
%prep
%setup -q
%patch01 -p1
%patch 1 -p1
%patch 2 -p1
%build
mkdir build && cd build
@ -130,6 +132,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Apr 30 2024 houhongxun <houhongxun@kylinos.cn> - 3.1-5
- fix incorrect use of self implemented vector
* Thu Jun 15 2023 peijiankang <peijiankang@kylinos.cn> - 3.1-4
- Type:bugfix
- ID:NA