[VW7.8] How to find duplicate methods in source or code?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[VW7.8] How to find duplicate methods in source or code?

askoh
Administrator
I want to find methods that are identical in source code and/or compiled code. How can I do that efficiently?

Thanks,
Aik-Siong Koh
Reply | Threaded
Open this post in threaded view
|

Re: [VW7.8] How to find duplicate methods in source or code?

Reinout Heeck-2
On 2/7/2014 11:03 PM, askoh wrote:
> I want to find methods that are identical in source code and/or compiled
> code. How can I do that efficiently?

|byCompilationResult|
byCompilationResult := Dictionary new.
Smalltalk enumerateMethods:
         [:behavior :selector :compiled |
         | key |
         key := Array with: compiled bytes with: compiled literals.
         (byCompilationResult at: key ifAbsentPut: [Set new])
             add: compiled definition].
byCompilationResult := (byCompilationResult reject: [:set | set size =
1]) collect: #asArray.
byCompilationResult  inspect


R
-





>
> Thanks,
> Aik-Siong Koh
>
>
>
> --
> View this message in context: http://forum.world.st/VW7-8-How-to-find-duplicate-methods-in-source-or-code-tp4742255.html
> Sent from the VisualWorks mailing list archive at Nabble.com.
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc