示例#1
0
int searchHash(uint8_t *hash, chunkList *chunkPool, int fetchState)
{
    int i;
    for(i = 0; i < chunkPool->numChunk; i++) {
        chunkLine *line = &(chunkPool->list[i]);
        int matched = sameHash(line->hash, hash, SHA1_HASH_SIZE);
        if(fetchState >= 0) {
            matched = matched && line->fetchState == fetchState;
        }
        if(matched) {
            return i;
        }
    }
    return -1;
}
示例#2
0
    bool same(AstNUser* node1p, AstNUser* node2p) {
	return node1p == node2p || sameHash((AstNode*)node1p,(AstNode*)node2p);
    }