[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkstars=5D_kstars=3A_Use_qMax_to_find_maximum_of_two?=
From: Khudyakov Alexey <alexey.skladnoy () gmail ! com>
Date: 2011-04-05 18:12:46
Message-ID: 20110405181246.65A1DA60A6 () git ! kde ! org
[Download RAW message or body]
Git commit ac11ed858ccd98940c7e94b9f82d96369f6e4aa5 by Khudyakov Alexey.
Committed on 05/04/2011 at 20:11.
Pushed by khudyakov into branch 'master'.
Use qMax to find maximum of two elements
M +2 -7 kstars/texturemanager.cpp
http://commits.kde.org/kstars/ac11ed858ccd98940c7e94b9f82d96369f6e4aa5
diff --git a/kstars/texturemanager.cpp b/kstars/texturemanager.cpp
index d7ff081..819704b 100644
--- a/kstars/texturemanager.cpp
+++ b/kstars/texturemanager.cpp
@@ -78,17 +78,12 @@ TextureManager *TextureManager::Create() {
Texture* TextureManager::createTexture( QImage image )
{
- int longest, tex_size = 2;
Texture *texture = new Texture( m_p );
-
// Resize image if necessary and create texture
if ( image.width() != image.height() || ( image.width() & ( image.width() - 1 ) ) ) {
// Compute texture size
- if ( image.width() > image.height() )
- longest = image.width();
- else
- longest = image.height();
-
+ int longest = qMax( image.width(), image.height() );
+ int tex_size = 2;
while ( tex_size < longest ) {
tex_size *= 2;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic