mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-21 11:16:08 +03:00
font: fix hashing of descriptor strings
This commit is contained in:
@ -556,7 +556,7 @@ pub const Key = struct {
|
||||
const autoHash = std.hash.autoHash;
|
||||
autoHash(hasher, self.descriptors.len);
|
||||
for (self.descriptors) |d| d.hash(hasher);
|
||||
autoHash(hasher, self.codepoint_map);
|
||||
self.codepoint_map.hash(hasher);
|
||||
autoHash(hasher, self.metric_modifiers.count());
|
||||
if (self.metric_modifiers.count() > 0) {
|
||||
inline for (@typeInfo(Metrics.Key).Enum.fields) |field| {
|
||||
|
@ -60,8 +60,9 @@ pub const Descriptor = struct {
|
||||
/// Hash the descriptor with the given hasher.
|
||||
pub fn hash(self: Descriptor, hasher: anytype) void {
|
||||
const autoHash = std.hash.autoHash;
|
||||
autoHash(hasher, self.family);
|
||||
autoHash(hasher, self.style);
|
||||
const autoHashStrat = std.hash.autoHashStrat;
|
||||
autoHashStrat(hasher, self.family, .Deep);
|
||||
autoHashStrat(hasher, self.style, .Deep);
|
||||
autoHash(hasher, self.codepoint);
|
||||
autoHash(hasher, self.size);
|
||||
autoHash(hasher, self.bold);
|
||||
|
Reference in New Issue
Block a user