Package: opencc / 1.1.1+git20200624+ds2-10

Metadata

Package Version Patches format
opencc 1.1.1+git20200624+ds2-10 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 use cmake install libdir.patch | (download)

CMakeLists.txt | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 use-cmake-install-libdir

===================================================================

0002 use system libraries.patch | (download)

src/CMakeLists.txt | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 use-system-libraries


0003 data Explicitly use python3.patch | (download)

data/scripts/find_target.py | 2 1 + 1 - 0 !
data/scripts/merge.py | 2 1 + 1 - 0 !
data/scripts/reverse.py | 2 1 + 1 - 0 !
data/scripts/sort.py | 2 1 + 1 - 0 !
data/scripts/sort_all.py | 2 1 + 1 - 0 !
5 files changed, 5 insertions(+), 5 deletions(-)

 data/: explicitly use python3

Before "python" is default to python3, this patch should be kept.

0004 no remote images when reading docs on disk.patch | (download)

README.md | 8 4 + 4 - 0 !
1 file changed, 4 insertions(+), 4 deletions(-)

 don't fetch remote images when reading docs on disk

0005 Use system googletest.patch | (download)

CMakeLists.txt | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 use system googletest

0006 Fix a bug in the calculation of DictGroup keyMaxLeng.patch | (download)

src/DictGroup.cpp | 16 14 + 2 - 0 !
src/DictGroupTest.cpp | 32 24 + 8 - 0 !
2 files changed, 38 insertions(+), 10 deletions(-)

 fix a bug in the calculation of dictgroup::keymaxlength.

The length should be the maximum of all sub-dictionaries in the dictionary group.

0007 Fix a severe performance bug in Conversion Convert t.patch | (download)

src/Dict.hpp | 7 7 + 0 - 0 !
src/benchmark/Performance.cpp | 77 62 + 15 - 0 !
2 files changed, 69 insertions(+), 15 deletions(-)

 fix a severe performance bug in `conversion::convert` that caused
 O(N^2) complexity.

In `Conversion.cpp`, line 27:
```
    Optional<const DictEntry*> matched = dict->MatchPrefix(pstr);
```
pstr is a `const char*`. However, there is no overloaded function which parameter `const char*`.
Therefore it matches `Optional<const DictEntry*> MatchPrefix(const std::string& word) const`.
There is an implicit type conversion from `char*` to `std::string` with time complexity O(N).

I added new benchmark tests. Before the fix:

1: