Posted By

romech on 03/22/12


Tagged

array duplicate point duplicating


Versions (?)

Remove duplicating Points from Array


 / Published in: ActionScript 3
 

URL: unique-points-array

Removes duplicating elements from Array, containing only objects of Point class

  1. function removeDuplicates (input:Array):Array
  2. {
  3. var unique:Array = new Array();
  4. testLoop:for (var l:uint = 0; l < input.length; l++)
  5. {
  6. for (var m:uint = 0; m < unique.length; m++)
  7. {
  8. if ((input[l] as Point).equals(unique[m]))
  9. {
  10. continue testLoop;
  11. }
  12. }
  13. unique.push(input[l]);
  14. }
  15. return unique;
  16. }

Report this snippet  

You need to login to post a comment.