You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can change another way if we can convert bool to int:
varaTableToSearch= []int64{xxxx}
varaint=1234funcgetValueFromTable(indexint) int64{
returnaTableToSearch[index*BoolToInt(!(a>1000))]
}
funcBoolToInt(bbool) int{
returnint(*(*uint8)(unsafe.Pointer(&b))) // this way is slow, use assemly
}
The text was updated successfully, but these errors were encountered:
Proposal Details
sometimes I don't want to use
if
when search a table.So if we can convert a bool value to int, then we can reduce
if
clause .For example:
We can change another way if we can convert bool to int:
The text was updated successfully, but these errors were encountered: