What is a better way to accomplish this?

What is a better way to accomplish this?

Attached: 1519535820885.png (850x800, 115K)

Yes

Fine I'll take the bait

y = x;

Yeah

What about this??

Attached: 1519610852055.jpg (929x3380, 216K)

What if x = "OP is a faggot"

void setYToX(const bool *x, bool *y) {
for (int i = 0, c = sizeof(*x)*CHAR_BIT; i < c; ++i) {
int z = 1

Then the compiler would optimize that to y = true, and then it optimize any use of y

unironically could perform great on MCUs if you optimize for speed and not for space

no it wouldn't, it's going to get compiled to an if ladder

Actually switch cases get compiled to a map of case values to predicates.
Technically the lookup would be O(1) but then there's added function call overhead.

I should clarify that this is a c# feature which is what the image is.

fUCK

You forgot tralse.

what do you think a "map" is? For 64 cases, a hash array doesn't make any sense. Binary search in for a sorted list is going to be compiled as ifs with a maximum depth of 6

You're glowing CIA nigger. The CIA wants you to THINK it's an if ladder, actually it's a lookup table.

>hash array doesn't make any sense
But that's what happens
Take it up with Microsoft

bool setToOtherBool(const bool &b)
{
return b;
}

Not equivalent.

The OP uses else if, not else.

Therefore if x is neither true nor false then y will not be assigned.

any source? I don't believe clr to be that primitive.

if (x)||not(x) {
x = y
}

Just run that code snippet throw ildasm. Sorry I would do it myself but I'm phoneposting

Type was never mentioned so it's fair to assume bool rather than tralse.

Attached: j45kd8usp5801.jpg (834x1196, 84K)

Yeah. Easy: Don't use JavaScript.

Did you just assume the type of that variable? Two weeks sensibly training will hopefully set you straight.

Screw your sensitivity training, I only accept type-safe-pure languages. Type mixing was a mistake!

tralse

>tfw no three value boolean in my shitlang

Hope this helps
//Copyright 2019 user

//Sets x as true
var x = true;
var y = setYTrueBasedOnX(x);

console.log(y);

function setYTrueBasedOnX(x){
//This function returns a value based on the passed variable.
//It only works if the passed value is true or false.
//This is an if statement.
if(x){
//This returns true.
return true;
}
//This is the second part of the if statement. It will only execute when if the first part didn't match.
else If(!x){
//This returns false.
return false;
}
//This is the end of the IF statement
}
//This is the end of the function