On 02/18/2012 03:21 PM, julien2412 wrote:
This subject, switch/if else, reminded me what I read recently on the
Stroustrup book.
1) The fact that switch allows a better quality machine code.
I wouldn't bet anything on that one. Compilers should be able to
automatically identify
I have a 'replacement' patch that actually replaces most of if...else if...else
chains with
switches.
They are more legible and seem natural when choosing branches depending on the
same variable.
The performance of a switch should also be better, but turbo boost should not
be expected ;).
Two
On 18.02.2012 17:29, Mariusz Dykierek wrote:
I have a 'replacement' patch that actually replaces most of if...else if...else
chains with
switches.
Great!
They are more legible and seem natural when choosing branches depending on the
same variable.
On the other hand, the evaluated
On 2012-02-18 14:41, Ivan Timofeev wrote:
On 18.02.2012 17:29, Mariusz Dykierek wrote:
I have a 'replacement' patch that actually replaces most of if...else
if...else chains with
switches.
Great!
They are more legible and seem natural when choosing branches depending on
the same
This subject, switch/if else, reminded me what I read recently on the
Stroustrup book.
1) The fact that switch allows a better quality machine code.
2) an enumeration used with a switch allows a compiler to detect a case
which has be forgotten.
Now, I'm not a senior C++ dev at all, just a
Il 16/02/2012 00:02, Mariusz Dykierek ha scritto:
+ some simplification
+sal_Bool bLeft = sal_True;
+if ( ( meAlign == WINDOWALIGN_TOP ) || ( meAlign ==
WINDOWALIGN_LEFT ) )
+bLeft = sal_False;
I think that keeping possible values explicit could be a good thing
On 02/16/2012 09:35 AM, Riccardo Magliocchetti wrote:
Otherwise you can simplify it even more:
sal_Bool bLeft = (meAlign == WINDOWALIGN_TOP || meAlign ==
WINDOWALIGN_LEFT) ? sal_False : sal_True;
... which of course reduces to
bool bLeft = !(meAlign == WINDOWALIGN_TOP || meAlign ==
On 2012-02-16 10:02, Stephan Bergmann wrote:
On 02/16/2012 09:35 AM, Riccardo Magliocchetti wrote:
Otherwise you can simplify it even more:
sal_Bool bLeft = (meAlign == WINDOWALIGN_TOP || meAlign ==
WINDOWALIGN_LEFT) ? sal_False : sal_True;
... which of course reduces to
bool bLeft =
Hi all,
--
Mariusz Dykierek mariuszdykie...@gmail.com wrote:
(16/02/2012 11:46)
On 2012-02-16 10:02, Stephan Bergmann wrote:
On 02/16/2012 09:35 AM, Riccardo Magliocchetti wrote:
Otherwise you can simplify it even more:
sal_Bool bLeft =
On 02/16/2012 12:18 PM, Matteo Casalin wrote:
I personally find 'if' more legible than ?: and definitely expressions like b =
x==y || x==z;
I am not sure if WindowAlign will always have only these 4 members and possibly
the author of
the original version wasn't either (thus final else).
Since
+ some simplification
--
Regards,
Mariusz Dykerek
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index f5da206..09ad468 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -2035,17 +2035,9 @@ void SplitWindow::ImplDrawFadeIn(
11 matches
Mail list logo