StatCache *DocStat;
} ArrayCache;
-static void
+static void
moveFirst(ArrayCache *ac, ArrayCacheEntry *entry)
{
/*
}
/*
- * Install into head
+ * Install into head
*/
Assert( ac->head != NULL );
ac->head = entry;
}
-#define DATUMSIZE(d) VARSIZE_ANY(DatumGetPointer(d))
+#define DATUMSIZE(d) VARSIZE_ANY(DatumGetPointer(d))
static int
cmpDatum(Datum a, Datum b)
{
ac->ctx = ctx;
/*
- * Fast check of resent used value
+ * Fast check of resent used value
*/
if ( ac->head && cmpDatum(ac->head->toastedArray, a) == 0 )
{
ArrayCacheEntry **StopMiddle;
int cmp;
- while (StopLow < StopHigh) {
+ while (StopLow < StopHigh) {
StopMiddle = StopLow + ((StopHigh - StopLow) >> 1);
entry = *StopMiddle;
- cmp = cmpDatum(entry->toastedArray, a);
+ cmp = cmpDatum(entry->toastedArray, a);
if ( cmp == 0 )
{
} while(0);
/*
- * Not found
+ * Not found
*/
if ( ac->nentries < NENTRIES )
makeEntry(ac, ac->head, a);
fetchData(ac, ac->head, da, sa, ss);
- }
+ }
else
{
cleanupData( ac->tail );
fetchData(ac, ac->head, da, sa, ss);
}
- qsort(ac->entries, ac->nentries, sizeof(ArrayCacheEntry*), cmpEntry);
+ qsort(ac->entries, ac->nentries, sizeof(ArrayCacheEntry*), cmpEntry);
return cache;
}
if ( typoid != ac->DocStat->info->typid )
elog(ERROR,"Types of stat table and actual arguments are different");
- return findStat(ac->DocStat, query, low);
+ return findStat(ac->DocStat, query, low);
}
StatCache *
getStat(void *cache, size_t n)
{
- ArrayCache *ac;
+ ArrayCache *ac;
if ( cache == NULL )
return NULL;