@@ -29,7 +29,7 @@ inline core::smart_refctd_ptr<ICPUShader> nbl::asset::IShaderCompiler::compileTo
29
29
CCache::SEntry entry;
30
30
std::vector<CCache::SEntry::SPreprocessingDependency> dependencies;
31
31
if (options.readCache || options.writeCache )
32
- entry = std::move ( CCache::SEntry (code, options) );
32
+ entry = CCache::SEntry (code, options);
33
33
34
34
if (options.readCache )
35
35
{
@@ -270,31 +270,25 @@ core::smart_refctd_ptr<asset::ICPUShader> IShaderCompiler::CCache::find(const SE
270
270
271
271
IShaderCompiler::CCache::EntrySet::const_iterator IShaderCompiler::CCache::find_impl (const SEntry& mainFile, const IShaderCompiler::CIncludeFinder* finder) const
272
272
{
273
- auto foundRange = m_container.equal_range (mainFile);
274
- for (auto & found = foundRange.first ; found != foundRange.second ; found++)
273
+ auto found = m_container.find (mainFile);
274
+ // go through all dependencies
275
+ for (auto i = 0 ; i < found->dependencies .size (); i++)
275
276
{
276
- bool allDependenciesMatch = true ;
277
- // go through all dependencies
278
- for (auto i = 0 ; i < found->dependencies .size (); i++)
279
- {
280
- const auto & dependency = found->dependencies [i];
277
+ const auto & dependency = found->dependencies [i];
281
278
282
- IIncludeLoader::found_t header;
283
- if (dependency.standardInclude )
284
- header = finder->getIncludeStandard (dependency.requestingSourceDir , dependency.identifier );
285
- else
286
- header = finder->getIncludeRelative (dependency.requestingSourceDir , dependency.identifier );
279
+ IIncludeLoader::found_t header;
280
+ if (dependency.standardInclude )
281
+ header = finder->getIncludeStandard (dependency.requestingSourceDir , dependency.identifier );
282
+ else
283
+ header = finder->getIncludeRelative (dependency.requestingSourceDir , dependency.identifier );
287
284
288
- if (header.hash != dependency.hash )
289
- {
290
- allDependenciesMatch = false ;
291
- break ;
292
- }
285
+ if (header.hash != dependency.hash )
286
+ {
287
+ return m_container.end ();
293
288
}
294
- if (allDependenciesMatch)
295
- return found;
296
289
}
297
- return m_container.end ();
290
+
291
+ return found;
298
292
}
299
293
300
294
core::smart_refctd_ptr<ICPUBuffer> IShaderCompiler::CCache::serialize () const
0 commit comments