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:
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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++
|
||||
}
|
||||
|
@ -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++
|
||||
}
|
||||
|
Reference in New Issue
Block a user