-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
02 ternary v4 #30
base: master
Are you sure you want to change the base?
02 ternary v4 #30
Conversation
…t for some homeworks. Fixed build of gmock. Fixed std::abs conflict.
@@ -21,7 +21,7 @@ If your language provides a method in the standard library to perform the conver | |||
|
|||
int IntFromTernaryNumberString(const std::string& ternaryNumberString) | |||
{ | |||
return 1; | |||
return ternaryNumberString.front() - '0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
как только ты добавляешь front() или back() сразу стоит задуматься о тесте с пустой строкой :)
@@ -26,7 +26,7 @@ int IntFromTernaryNumberString(const std::string& ternaryNumberString) | |||
return (ternaryNumberString.front() - '0') * 3; | |||
} | |||
|
|||
return ternaryNumberString.back() - '0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не совсем понял с чем связано это изменение на этапе красного теста
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ты наверное даже немного перестарался с маленькими шагами, std::pow можно было ввести раньше (на этапе рефакторинга теста на 100), это сделало бы переход к циклу более очевидным и ты на том же этапе рефакторинга смог бы его ввести
No description provided.