diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2011-01-21 15:28:53 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-01-21 15:30:23 (GMT) |
commit | 75771ddf96273899a990d33395fb4fac14666022 (patch) | |
tree | 26bc4415881e7318e9799bd4c42c114953b14f97 /src/corelib/kernel | |
parent | 3539af42ca847e628c325a2069b72284b597d617 (diff) | |
download | Qt-75771ddf96273899a990d33395fb4fac14666022.zip Qt-75771ddf96273899a990d33395fb4fac14666022.tar.gz Qt-75771ddf96273899a990d33395fb4fac14666022.tar.bz2 |
avoid extra calculations
QSystemSemaphore::setKey() sets the fileName member to makeKeyFileName()'s result;
no need to call it again
Merge-request: 1018
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qsystemsemaphore_symbian.cpp | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qsystemsemaphore_win.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp index a46389d..0d257b8 100644 --- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp +++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp @@ -98,8 +98,7 @@ int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode) if (key.isEmpty()) return 0; - QString safeName = makeKeyFileName(); - TPtrC name(qt_QString2TPtrC(safeName)); + TPtrC name(qt_QString2TPtrC(fileName)); int err = KErrAlreadyExists; int tryCount = 10; // Sort out race conditions by retrying several times until existing handle is acquired. diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp index 7f002f8..fad50f2 100644 --- a/src/corelib/kernel/qsystemsemaphore_win.cpp +++ b/src/corelib/kernel/qsystemsemaphore_win.cpp @@ -86,8 +86,7 @@ HANDLE QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode) // Create it if it doesn't already exists. if (semaphore == 0) { - QString safeName = makeKeyFileName(); - semaphore = CreateSemaphore(0, initialValue, MAXLONG, (wchar_t*)safeName.utf16()); + semaphore = CreateSemaphore(0, initialValue, MAXLONG, (wchar_t*)fileName.utf16()); if (semaphore == NULL) setErrorString(QLatin1String("QSystemSemaphore::handle")); } |