A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/icsharpcode/ILSpy/issues/1822 below:

Tuples comparison question · Issue #1822 · icsharpcode/ILSpy · GitHub

Just gave a try to some new features like tuple comparison

input code was a singleliner like

return tup1 != tup2 && tup2 == (tup1.a + tup1.b, 0);

output looks very interesting, eg as per ILSpy version 6.0.0.5404-alpha1

private bool CompTuples1((int a, int b) tup1, (int a, int b) tup2)
	{
		(int, int) valueTuple = tup1;
		(int, int) valueTuple2 = tup2;
		int result;
		if (valueTuple.Item1 != valueTuple2.Item1 || valueTuple.Item2 != valueTuple2.Item2)
		{
			valueTuple2 = tup2;
			int num = tup1.a + tup1.b;
			result = ((valueTuple2.Item1 == num && valueTuple2.Item2 == 0) ? 1 : 0);
		}
		else
		{
			result = 0;
		}
		return (byte)result != 0;
	}

Expectation: more user friendly tuple support :)

ILSPY_testa1.zip


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4