1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: remove redundant parentheses in if statements

This commit is contained in:
Alexey
2020-03-29 11:08:42 +03:00
committed by GitHub
parent e09447d011
commit a333ac1888
13 changed files with 16 additions and 18 deletions

View File

@@ -62,7 +62,7 @@ pub fn (r mut Readline) enable_raw_mode() {
// Enable the raw mode of the terminal
// Does not catch the SIGUSER (CTRL+C) Signal
pub fn (r mut Readline) enable_raw_mode_nosig() {
if ( C.tcgetattr(0, &r.orig_termios) == -1 ) {
if C.tcgetattr(0, &r.orig_termios) == -1 {
r.is_tty = false
r.is_raw = false
return
@@ -319,7 +319,7 @@ fn calculate_screen_position(x_in int, y_in int, screen_columns int, char_count
out[0] = x
out[1] = y
for chars_remaining := char_count; chars_remaining > 0; {
chars_this_row := if ( (x + chars_remaining) < screen_columns) { chars_remaining } else { screen_columns - x }
chars_this_row := if (x + chars_remaining) < screen_columns { chars_remaining } else { screen_columns - x }
out[0] = x + chars_this_row
out[1] = y
chars_remaining -= chars_this_row