From 5bd11b5a8c2f627bc9c9f1b6c02602772ad67dae Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 16 Mar 2017 09:44:50 +0100 Subject: Avoid an extra stat() on the source .qml file when loading cache For timestamp comparison it is not necessary to create another QFileInfo() object and call exists() and lastModified(), when we can pass that information through from the type loader. Change-Id: I225cd36e672f1f390bddb4e6ebfafa3fc1269795 Reviewed-by: Lars Knoll --- tools/qmljs/qmljs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/qmljs') diff --git a/tools/qmljs/qmljs.cpp b/tools/qmljs/qmljs.cpp index 4d0f9d278f..14a20731c0 100644 --- a/tools/qmljs/qmljs.cpp +++ b/tools/qmljs/qmljs.cpp @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) if (cache && QFile::exists(fn + QLatin1Char('c'))) { QQmlRefPointer unit = iSelFactory->createUnitForLoading(); QString error; - if (unit->loadFromDisk(QUrl::fromLocalFile(fn), iSelFactory, &error)) { + if (unit->loadFromDisk(QUrl::fromLocalFile(fn), QFileInfo(fn).lastModified(), iSelFactory, &error)) { script.reset(new QV4::Script(&vm, nullptr, unit)); } else { std::cout << "Error loading" << qPrintable(fn) << "from disk cache:" << qPrintable(error) << std::endl; -- cgit v1.2.3