mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 11:16:29 +03:00
rose: move sparse iter cache to RoseEngineBlob
This enables its use for iterators written by instructions.
This commit is contained in:
committed by
Matthew Barr
parent
13b6023a18
commit
9139123642
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Intel Corporation
|
||||
* Copyright (c) 2015-2016, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -34,16 +34,18 @@
|
||||
#define MULTIBIT_BUILD_H
|
||||
|
||||
#include "multibit_internal.h"
|
||||
#include "hash.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
/** \brief Comparator for \ref mmbit_sparse_iter structures. */
|
||||
static inline
|
||||
bool operator<(const mmbit_sparse_iter &a, const mmbit_sparse_iter &b) {
|
||||
if (a.mask != b.mask) {
|
||||
return a.mask < b.mask;
|
||||
}
|
||||
return a.val < b.val;
|
||||
inline
|
||||
bool operator==(const mmbit_sparse_iter &a, const mmbit_sparse_iter &b) {
|
||||
return a.mask == b.mask && a.val == b.val;
|
||||
}
|
||||
|
||||
inline
|
||||
size_t hash_value(const mmbit_sparse_iter &iter) {
|
||||
return ue2::hash_all(iter.mask, iter.val);
|
||||
}
|
||||
|
||||
namespace ue2 {
|
||||
|
Reference in New Issue
Block a user