Skip to content

Commit bf4c82e

Browse files
committed
Do not save cache if not needed.
1 parent c05fd6f commit bf4c82e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/jni/Require.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ namespace tns
254254

255255
void Require::SaveScriptCache(const ScriptCompiler::Source& source, const std::string& path)
256256
{
257+
if(!Constants::V8_CACHE_COMPILED_CODE)
258+
{
259+
return;
260+
}
261+
257262
int length = source.GetCachedData()->length;
258263
auto cachePath = path + ".cache";
259264
auto file = fopen(cachePath.c_str(), "wb" /* write binary */);

0 commit comments

Comments
 (0)