File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -288,9 +288,8 @@ bool CopyPasteManager::ExpressionRegExMatch(
288288 }
289289 else if (mode == ViewMode::Programmer)
290290 {
291- patterns.assign (
292- programmerModePatterns[(int )programmerNumberBase - (int )NumberBase::HexBase].begin (),
293- programmerModePatterns[(int )programmerNumberBase - (int )NumberBase::HexBase].end ());
291+ auto pattern = &programmerModePatterns[static_cast <int >(programmerNumberBase) - static_cast <int >(NumberBase::HexBase)];
292+ patterns.assign (pattern->begin (), pattern->end ());
294293 }
295294 else if (modeType == CategoryGroupType::Converter)
296295 {
@@ -505,18 +504,15 @@ ULONG32 CopyPasteManager::StandardScientificOperandLength(Platform::String ^ ope
505504 const bool hasDecimal = operandWstring.find (' .' ) != wstring::npos;
506505 auto length = operandWstring.length ();
507506
508- if (hasDecimal)
507+ if (hasDecimal && length >= 2 )
509508 {
510- if (length >= 2 )
509+ if ((operandWstring[ 0 ] == L ' 0 ' ) && (operandWstring[ 1 ] == L ' . ' ) )
511510 {
512- if ((operandWstring[0 ] == L' 0' ) && (operandWstring[1 ] == L' .' ))
513- {
514- length -= 2 ;
515- }
516- else
517- {
518- length -= 1 ;
519- }
511+ length -= 2 ;
512+ }
513+ else
514+ {
515+ length -= 1 ;
520516 }
521517 }
522518
You can’t perform that action at this time.
0 commit comments