Skip to content
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

remove redundant variable assignments #1369

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private string ConvertIntBH(long number, bool returnPluralized)

private string ConvertIntBT(long number, bool returnPluralized)
{
var result = "";
string result;

if (number / 100 == 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override string Convert(long input, GrammaticalGender gender, bool addAnd

if (number / 1000000 > 0)
{
var millionPart = "";
string millionPart;
if (number == 1000000)
{
millionPart = "miljons";
Expand All @@ -34,7 +34,7 @@ public override string Convert(long input, GrammaticalGender gender, bool addAnd

if (number / 1000 > 0)
{
var thousandsPart = "";
string thousandsPart;
if (number == 1000)
{
thousandsPart = "tūkstotis";
Expand All @@ -53,7 +53,7 @@ public override string Convert(long input, GrammaticalGender gender, bool addAnd

if (number / 100 > 0)
{
var hundredsPart = "";
string hundredsPart;
if (number == 100)
{
hundredsPart = parts.Contains("tūkstoš") ? "viens simts" : "simts";
Expand Down Expand Up @@ -104,7 +104,7 @@ public override string ConvertToOrdinal(int input, GrammaticalGender gender)

if (number / 1000000 > 0)
{
var millionPart = "";
string millionPart;
if (number == 1000000)
{
millionPart = "miljon" + GetOrdinalEndingForGender(gender);
Expand All @@ -119,7 +119,7 @@ public override string ConvertToOrdinal(int input, GrammaticalGender gender)

if (number / 1000 > 0)
{
var thousandsPart = "";
string thousandsPart;
if (number % 1000 == 0)
{
if (number == 1000)
Expand Down Expand Up @@ -148,7 +148,7 @@ public override string ConvertToOrdinal(int input, GrammaticalGender gender)

if (number / 100 > 0)
{
var hundredsPart = "";
string hundredsPart;
if (number % 100 == 0)
{
hundredsPart = HundredsMap[number / 100] + GetOrdinalEndingForGender(gender);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private static string GetHundreds(long value, bool usePrefixMap, bool usePrefixM
var tens = value % 100;
var numberOfHundreds = value / 100;

var hundredsText = string.Empty;
string hundredsText;
if (numberOfHundreds == 1)
{
hundredsText = "mija";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,25 +236,22 @@ private static string GetThousandsValue(ref long number)
}
private static string GetHundredsValue(ref long number)
{
var local_word = "";
var local_word = HundredsMap[number / 100 - 1];
if (number / 100 == 9)
{
local_word = HundredsMap[number / 100 - 1];
if (number / 100 == 9)
{
if (number % 100 == 0)
local_word += "ம்";
else
local_word += "த்து";
}
else if (number % 100 >= 1)
local_word += "ற்று";
if (number % 100 == 0)
local_word += "ம்";
else
local_word += "று";
local_word += "த்து";
}
else if (number % 100 >= 1)
local_word += "ற்று";
else
local_word += "று";

number %= 100;
number %= 100;

return local_word;
}
return local_word;
}

private static string RemoveOnePrefix(string toWords)
Expand Down