Posting* StringType_Make_Posting_IMP(StringType *self, Similarity *similarity) { if (similarity) { return (Posting*)ScorePost_new(similarity); } else { Similarity *sim = StringType_Make_Similarity(self); Posting *posting = (Posting*)ScorePost_new(sim); DECREF(sim); return posting; } }
static void S_add_string_field(Schema *self, String *field, FieldType *type) { SchemaIVARS *const ivars = Schema_IVARS(self); StringType *string_type = (StringType*)CERTIFY(type, STRINGTYPE); Similarity *sim = StringType_Make_Similarity(string_type); // Cache helpers. Hash_Store(ivars->sims, field, (Obj*)sim); // Store FieldType. Hash_Store(ivars->types, field, INCREF(type)); }