std/lib/hash: rename receiver to self

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
Pierre Curto
2023-07-04 20:34:56 +02:00
committed by Christoffer Lerno
parent daa952d990
commit 731729cf1b
4 changed files with 32 additions and 32 deletions

View File

@@ -10,24 +10,24 @@ const FNV32A_MUL @private = 0x01000193;
macro void @update(uint &h, char x) @private => h = (h * FNV32A_MUL) ^ x;
fn void Fnv32a.init(&this)
fn void Fnv32a.init(&self)
{
*this = FNV32A_START;
*self = FNV32A_START;
}
fn void Fnv32a.update(&this, char[] data)
fn void Fnv32a.update(&self, char[] data)
{
uint h = (uint)*this;
uint h = (uint)*self;
foreach (char x : data)
{
@update(h, x);
}
*this = (Fnv32a)h;
*self = (Fnv32a)h;
}
macro void Fnv32a.update_char(&this, char c)
macro void Fnv32a.update_char(&self, char c)
{
@update(*this, x);
@update(*self, x);
}
fn uint encode(char[] data)