使用Visual Studio删除文本中的空行(Remove empty lines in text using Visual Studio)
如何在Visual Studio中删除空行?
How to remove empty lines in Visual Studio?
原文:https://stackoverflow.com/questions/12453160
最满意答案
它可能是可测量的,如果它正在进行数十亿次,很少有其他工作。 我不知道CLR是否会有效地缓存这个演员的事实,所以它不需要再做一次 - 如果现在不这样做,它可能会在以后的版本中这样做。 它可能在64位JIT中执行,但不是32位版本,反之亦然 - 你会得到想法。 我怀疑它会在正常代码中产生重大的区别。
就个人而言,我更喜欢第二种形式的可读性 ,而这更重要。
It may be measurable if it's being done billions of times with very little other work. I don't know whether the CLR will effectively cache the fact that the cast worked, so it doesn't need to do it again - if it doesn't do so now, it might do so in a later release. It might do so in the 64 bit JIT but not the 32 bit version, or vice versa - you get the idea. I doubt that it would make a significant difference in normal code though.
Personally I like the readability of the second form more though, and that's more important by far.
相关问答
更多-
TypeCasting的性能(Performance of TypeCasting)[2023-01-04]
它可能是可测量的,如果它正在进行数十亿次,很少有其他工作。 我不知道CLR是否会有效地缓存这个演员的事实,所以它不需要再做一次 - 如果现在不这样做,它可能会在以后的版本中这样做。 它可能在64位JIT中执行,但不是32位版本,反之亦然 - 你会得到想法。 我怀疑它会在正常代码中产生重大的区别。 就个人而言,我更喜欢第二种形式的可读性 ,而这更重要。 It may be measurable if it's being done billions of times with very little othe ... -
Session.save返回Serializable-Object。 ( http://docs.jboss.org/hibernate/orm/3.5/javadocs/org/hibernate/Session.html#save%28java.lang.Object%29 ) 但是Object没有实现标记接口Serializable。 ( http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html ) Session.save retu ...
-
字节类型转换(Byte typecasting)[2023-09-24]
可用于此方法调用转换的转换是扩展的原始转换 : byte to short,int,long,float或double 短,int,long,float或double char到int,long,float或double int到long,float或double 长期浮动或加倍 漂浮加倍 你看到char路径没有byte 。 这不是优先事项:如果删除以int作为参数的函数,则代码将无法编译。 The conversion that may be used for this method invocation ... -
这种类型转换?(Is this typecasting? What is this?)[2022-09-17]
这是一种用于多态的类型转换。 您提出的第一个替代方案仅在基类Question具有setAnswer , setAlternative和setCorrectAlternative虚方法setAlternative setCorrectAlternative 。 如果没有,那么你必须将指针转换为良好类,以便找到方法。 第二种方法不起作用,因为first和second是指针,因此它们的值是地址。 将这些地址解释为类的对象本身就没有意义。 This is a type of type casting used fo ... -
我的代表是低评论,但是你不需要在使用之前查询和获取指针所指向的对象吗? 我不认为objectForKey正在获取它。 尝试 println(PFUser.currentUser!.objectForKey("userPointer")) Make sure you call Class.registerSubclass() in your AppDelegate so your app can recognize your classes!
-
类型转换(Typecasting Inversion)[2022-04-17]
〜b的结果是提升类型int (通常是b与任何其他一元运算符的结果+ , -或~ )所以你需要对结果进行类型转换。 来自C11规范草案第6.5.3.3节一元算术运算符: 〜运算符的结果是其( 提升的 )操作数的按位补码(也就是说,当且仅当未设置转换的操作数中的相应位时,才设置结果中的每个位)。 整数提升在操作数上执行 , 结果具有提升类型 。 如果提升类型是无符号类型 ,则表达式~E等于该类型中可表示的最大值减去E. 所以, unsigned char b = 0x00; /* ~b = 0xFFFFFFFF ... -
类型转换目标c对象根本不起作用,因为没有像c ++那样重载转换操作符。 所以基本上你只能安全地对具有常见超类的对象进行类型转换,例如NSMutableString和NSString等。 但你不需要这样做。 通常不需要对objc对象进行类型转换。 Typecasting objective c objects does not work at all, because there is no overloading of the cast operator as in c++. So basically yo ...
-
要使类型转换工作,类型需要兼容: object str = 10; int i = (int) str; 解析是不同类型之间的转换: string str = "10"; int i = int.Parse(str); For type casting to work the types need to be compatible: object str = 10; int i = (int) str; Parsing is conversion between different types: st ...
-
避免许多类型转换(Avoiding many typecasting)[2022-03-31]
您可以add aslate作为模板方法,并避免所有强制转换: class UIManager { public: templateT* add(T *element) { // do something with element return element; } } 然后您的客户端代码变为 button1 = manager->add(new Button(0, "Enter", Point(10, 10))); You ca ...