Format source code, add .exrc

This commit is contained in:
Jordan Bancino 2022-11-23 14:56:31 +00:00
parent 84f311ae09
commit 7544a97c7d
4 changed files with 30 additions and 20 deletions

2
.exrc Normal file
View file

@ -0,0 +1,2 @@
set tabstop=4
set expandtab

View file

@ -423,6 +423,9 @@ DbLockFromArr(Db * db, Array * args)
}
else
{
Array *name = ArrayCreate();
size_t i;
/* Not in cache; load from disk */
ref = Malloc(sizeof(DbRef));
@ -448,7 +451,12 @@ DbLockFromArr(Db * db, Array * args)
ref->ts = UtilServerTs();
ref->size = DbComputeSize(ref->json);
ref->name = ArrayDuplicate(args);
for (i = 0; i < ArraySize(args); i++)
{
ArrayAdd(name, UtilStringDuplicate(ArrayGet(args, i)));
}
ref->name = name;
HashMapSet(db->cache, hash, ref);
db->cacheSize += ref->size;