_Unwind_SjLj_Unregister和_Unwind_SjLj_Register是什么?在我的gprof报告中,我把它们作为我的顶级处理器时间用户。google只返回给抱怨这两个错误的人的链接。
下面是我的报告中唯一有时间的部分!= 0:
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
我有一个自定义助手方法,它输出保存的百分比。例如,它将计算一个项目的折扣,并输出"20 %折扣“。
我是本地化的网站中文,并在中文同样的折扣是不同的表示。"20%折扣“表示为"8削减”或"80%原价“。由于这两个表达式非常不同,我认为我需要编写助手方法的两个版本。
目前,我这样写它,检查助手本身中的区域设置:
def percent_off(discount, locale=I18n.locale)
if not locale.to_s.include?('zh')
n = ((1 - (discount.pref