[k3b] Review Request 120402: Don't preview if called process failed

Albert Astals Cid aacid at kde.org
Sun Sep 28 13:37:49 UTC 2014



> On set. 28, 2014, 8:53 a.m., Michal Malek wrote:
> > src/rip/videodvd/k3bvideodvdrippingpreview.cpp, line 124
> > <https://git.reviewboard.kde.org/r/120402/diff/1/?file=315608#file315608line124>
> >
> >     I suggest using more readable form:
> >     if( exitStatus != QProcess::NormalExit )
> 
> Johannes Obermayr wrote:
>     Isn't the CPU faster on "if( !exitStatus )"? It doesn't need to load value of QProcess::NormalExit (= 0).
>     IMHO comment "// exitStatus != QProcess::NormalExit" would be enough if really necessary.
>     Yes, today CPUs are fast enough to do the slower thing but better optimize if we can ...

But you are relying on people reading the code knowing that exitStatus == 0 is the good thing, you're doing the bad kind of optimization, one that gives you 0.000000000000000000000000000001% speedup but makes the code much harder to read for a third person. I also vote for 
   if( exitStatus != QProcess::NormalExit )


- Albert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120402/#review67546
-----------------------------------------------------------


On set. 28, 2014, 8:16 a.m., Johannes Obermayr wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120402/
> -----------------------------------------------------------
> 
> (Updated set. 28, 2014, 8:16 a.m.)
> 
> 
> Review request for K3b.
> 
> 
> Bugs: 268680
>     http://bugs.kde.org/show_bug.cgi?id=268680
> 
> 
> Repository: k3b
> 
> 
> Description
> -------
> 
> None
> 
> 
> Diffs
> -----
> 
>   src/rip/videodvd/k3bvideodvdrippingpreview.cpp 0c36c97 
> 
> Diff: https://git.reviewboard.kde.org/r/120402/diff/
> 
> 
> Testing
> -------
> 
> None
> 
> 
> Thanks,
> 
> Johannes Obermayr
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/k3b/attachments/20140928/89b5ed6c/attachment.html>


More information about the k3b mailing list