I am writing a function that returns 1 if a pattern is matched. Else it should return 0. Should I avoid the else statement and just return 0 as the last line? It won't affect the logic of the function, but what is the recommended way? Is there any site/book I can follow for such tips?
proc is_bus_net { net } {
set net_name [perc::name $net -fromTop]
if { [regexp {(\S+\)[\d+\]$} $net_name match first_name ]} {
puts "matched $net_name => $first_name"
return 1
}
return 0
}