Settings

Theme

If (((_ok)? true: (Math.random() 0.1))) {return res;}

github.com

8 points by neo2001 10 years ago · 3 comments

Reader

infogulch 10 years ago

The code in question is:

            } catch (Exception e) {
                if (!((_ok) ? true : (Math.random() > 0.1))) {
                    return res;
                }
                (error logging)
                _ok = false;
            }
A 10% percent chance to skip logging under certain circumstances. Very strange code, and a strange way to write it. Also wouldn't this be equivalent to

    if (!_ok || (Math.random() > 0.1))

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection