In Java's String class, the trim method contains this:
int off = offset; /* avoid getfield opcode */
char[] val = value; /* avoid getfield opcode */
I'm a bit puzzled by the comment "avoid getfield opcode"...
What does this mean? (I take it this avoids the use of getfield in the bytecode but why is this a Good Thing [TM]?)
Is it to prevent object creation in case trim doesn't do anything (and hence this is returned) or?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…