98143bd59423d34790c9f42f886c1f86

Is it possible once refactor this code?

triples( [], _,_,_)->
	[];

triples( Self, X, none, none )->
	[ Result || Result = { X1, _, _} <- Self, X =:= X1 ];

triples( Self, none, X, none )->
	[ Result || Result = { _, X1, _} <- Self, X =:= X1 ];

triples( Self, none, none, X )->
	[ Result || Result = { _, _, X1} <- Self, X =:= X1 ];

triples( Self, X, Y, none )->
	[ Result || Result = { X1, Y1, _} <- Self, X =:= X1, Y =:= Y1 ];

triples( Self, X, none, Y )->
	[ Result || Result = { X1, _, Y1} <- Self, X =:= X1, Y =:= Y1 ];

triples( Self, none, X, Y )->
	[ Result || Result = { _, X1, Y1} <- Self, X =:= X1, Y =:= Y1 ].

Refactorings

No refactoring yet !

451d41dc757ac0bdd396116a62c75590

Ellie

May 1, 2011, May 01, 2011 19:17, permalink

No rating. Login to rate!

IJWTS wow! Why can't I think of thngis like that?

IJWTS wow! Why can't I think of thngis like that?
451d41dc757ac0bdd396116a62c75590

Ellie

May 1, 2011, May 01, 2011 19:17, permalink

No rating. Login to rate!

IJWTS wow! Why can't I think of thngis like that?

IJWTS wow! Why can't I think of thngis like that?
451d41dc757ac0bdd396116a62c75590

Ellie

May 1, 2011, May 01, 2011 19:17, permalink

No rating. Login to rate!

IJWTS wow! Why can't I think of thngis like that?

IJWTS wow! Why can't I think of thngis like that?
451d41dc757ac0bdd396116a62c75590

Ellie

May 1, 2011, May 01, 2011 19:17, permalink

No rating. Login to rate!

IJWTS wow! Why can't I think of thngis like that?

IJWTS wow! Why can't I think of thngis like that?
451d41dc757ac0bdd396116a62c75590

Ellie

May 1, 2011, May 01, 2011 19:17, permalink

No rating. Login to rate!

IJWTS wow! Why can't I think of thngis like that?

IJWTS wow! Why can't I think of thngis like that?
Dd811e0a0f251cd97c8c3d78476fac5c

séjour linguistique

January 19, 2012, January 19, 2012 23:50, permalink

No rating. Login to rate!

what an invariant !

Dd811e0a0f251cd97c8c3d78476fac5c

séjour linguistique

January 19, 2012, January 19, 2012 23:50, permalink

No rating. Login to rate!

what an invariant !

Your refactoring





Format Copy from initial code

or Cancel