Android代码真是精益求精

看了一个ChangeLog,

     private OnItemClickListener mMessageClickedHandler = new OnItemClickListener() {
         public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
             Intent intent;
-            int i = position - 1;
+            position = position - 1;
             
-            switch (i) {
+            switch (position) {

一个变量都不想加,对应的ddx格式为:

 67     sub-int v0, p3, v2
 68 
 69     .line 339
 70     .local v0, i:I
 71     packed-switch v0, :pswitch_data_0


 67     sub-int/2addr p3, v1
 68 
 69     .line 339
 70     packed-switch p3, :pswitch_data_0
If you enjoyed this post, make sure you subscribe to my RSS feed!

2 thoughts on “Android代码真是精益求精

Leave a Reply

Your email address will not be published. Required fields are marked *