diff options
| author | Julian Andres Klode <jak@debian.org> | 2020-02-18 12:40:38 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2020-02-18 12:40:38 +0000 |
| commit | 1cab45a32c1b87f22ec80adf019eb3de7ef2605d (patch) | |
| tree | 8aa4ec8fc533526814fed6366d6d52adee053e22 /apt-pkg/deb/deblistparser.cc | |
| parent | 62683ed6459e874119f3346d8be66b85e8a90533 (diff) | |
| parent | 237ef6d210a0370131deb58277e77d579d58d15a (diff) | |
Merge branch 'pu/no-more-crc16' into 'master'
ABI break: Remove CRC-16
See merge request apt-team/apt!97
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
| -rw-r--r-- | apt-pkg/deb/deblistparser.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 7614423df..eaa9dfda9 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -14,7 +14,6 @@ #include <apt-pkg/aptconfiguration.h> #include <apt-pkg/cachefilter.h> #include <apt-pkg/configuration.h> -#include <apt-pkg/crc-16.h> #include <apt-pkg/deblistparser.h> #include <apt-pkg/error.h> #include <apt-pkg/hashes.h> @@ -339,7 +338,7 @@ bool debListParser::UsePackage(pkgCache::PkgIterator &Pkg, // ListParser::VersionHash - Compute a unique hash for this version /*{{{*/ // --------------------------------------------------------------------- /* */ -unsigned short debListParser::VersionHash() +uint32_t debListParser::VersionHash() { static constexpr pkgTagSection::Key Sections[] ={ pkgTagSection::Key::Installed_Size, @@ -350,7 +349,7 @@ unsigned short debListParser::VersionHash() pkgTagSection::Key::Conflicts, pkgTagSection::Key::Breaks, pkgTagSection::Key::Replaces}; - unsigned long Result = INIT_FCS; + unsigned long Result = 5381; for (auto I : Sections) { const char *Start; @@ -371,7 +370,7 @@ unsigned short debListParser::VersionHash() } if (isspace_ascii(*Start) != 0 || *Start == '=') continue; - Result = AddCRC16Byte(Result, tolower_ascii_unsafe(*Start)); + Result = 33 * Result + tolower_ascii_unsafe(*Start); } @@ -991,7 +990,7 @@ unsigned char debListParser::GetPrio(string Str) return Out; } /*}}}*/ -bool debListParser::SameVersion(unsigned short const Hash, /*{{{*/ +bool debListParser::SameVersion(uint32_t Hash, /*{{{*/ pkgCache::VerIterator const &Ver) { if (pkgCacheListParser::SameVersion(Hash, Ver) == false) |
