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

fmt: remove redundant parenthesis in the complex infix expr (#17873)

This commit is contained in:
yuyi
2023-04-04 18:47:48 +08:00
committed by GitHub
parent 8452644ec3
commit 467a1b4435
44 changed files with 141 additions and 117 deletions

View File

@ -74,7 +74,7 @@ fn bellman_ford[T](graph [][]T, src int) {
mut u := edges[j].src
mut v := edges[j].dest
mut weight := edges[j].weight
if (dist[u] != large) && (dist[u] + weight < dist[v]) {
if dist[u] != large && dist[u] + weight < dist[v] {
dist[v] = dist[u] + weight
}
}
@ -88,7 +88,7 @@ fn bellman_ford[T](graph [][]T, src int) {
mut u := edges[j].src
mut v := edges[j].dest
mut weight := edges[j].weight
if (dist[u] != large) && (dist[u] + weight < dist[v]) {
if dist[u] != large && dist[u] + weight < dist[v] {
print('\n Graph contains negative weight cycle')
// If negative cycle is detected, simply
// return or an exit(1)

View File

@ -77,7 +77,7 @@ fn build_path_reverse(graph map[string][]string, start string, final string, vis
for (current != start) {
for i in array_of_nodes {
if (current in graph[i]) && (visited[i] == true) {
if current in graph[i] && visited[i] == true {
current = i
break // the first ocurrence is enough
}

View File

@ -91,7 +91,7 @@ fn build_path_reverse(graph map[string][]string, start string, final string, vis
for current != start {
for i in array_of_nodes {
if (current in graph[i]) && (visited[i] == true) {
if current in graph[i] && visited[i] == true {
current = i
break // the first ocurrence is enough
}

View File

@ -41,7 +41,7 @@ fn push_pq[T](mut prior_queue []T, data int, priority int) {
lenght_pq := prior_queue.len
mut i := 0
for (i < lenght_pq) && (priority > prior_queue[i].priority) {
for i < lenght_pq && priority > prior_queue[i].priority {
temp << prior_queue[i]
i++
}

View File

@ -35,7 +35,7 @@ fn push_pq[T](mut prior_queue []T, data int, priority int) {
lenght_pq := prior_queue.len
mut i := 0
for (i < lenght_pq) && (priority > prior_queue[i].priority) {
for i < lenght_pq && priority > prior_queue[i].priority {
temp << prior_queue[i]
i++
}