Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decrement operator
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01344042
Message ID:
01344116
Vues:
19
>>>That's some evil code...
>>
>>Only because it doesn't work <g>
>
>No, no...it's really evil if it works ;-)
>
>Here, I've made that code even better by getting rid of all that unnecessary whitespace:
>
>
>    private int x2 = 1;
>    public int x
>    {
>        get {return x2;}
>        set{if(value==0){x2=x2==1?-1:1;}else x2=value;}
>    }	
>
Not quite all:
private int x2=1;public int x{get {return x2;}set{if(value==0){x2=x2==1?-1:1;}else x2=value;}}
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform