Commit 8d6ba3d3 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Optimize LoadJob::onNewEntry

Summary: Same observation and resolution as in D25565

Test Plan: Verified performance gain with hotspot

Reviewers: #ark, rthomsen

Reviewed By: #ark, rthomsen

Subscribers: rthomsen, dakon, kde-utils-devel

Tags: #ark

Differential Revision: https://phabricator.kde.org/D26356
parent 1e2af928
......@@ -33,7 +33,6 @@
#include <QDir>
#include <QDirIterator>
#include <QFileInfo>
#include <QRegularExpression>
#include <QThread>
#include <QTimer>
#include <QUrl>
......@@ -319,8 +318,12 @@ void LoadJob::onNewEntry(const Archive::Entry *entry)
}
if (m_isSingleFolderArchive) {
QString fullPath = entry->fullPath();
// RPM filenames have the ./ prefix, and "." would be detected as the subfolder name, so we remove it.
const QString fullPath = entry->fullPath().remove(QRegularExpression(QStringLiteral("^\\./")));
if (fullPath.startsWith(QLatin1String("./"))) {
fullPath = fullPath.remove(0, 2);
}
const QString basePath = fullPath.split(QLatin1Char('/')).at(0);
if (m_basePath.isEmpty()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment