Skip to content

Commit d164c61

Browse files
committed
format:代码格式处理。
1 parent 3897a2d commit d164c61

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

box_qimen/qm_v3.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ bool cppbox::CQimenV3::run(const QiParam& info, CalendarType type)
2222
// 1 4 7 10 下元
2323
int zhiIndex = futou % 12;
2424
// 直接找出当月的节气信息,看在哪个节气的后面
25-
const CDateTime& JieA = pcal_->get_jie().jq[2].dt_;
26-
const CDateTime& JieB = pcal_->get_jie().jq[3].dt_;
25+
const CDateTime& JieA = pcal_->get_jie().jq[2].dt_;
26+
const CDateTime& JieB = pcal_->get_jie().jq[3].dt_;
2727

2828
// --- 节气1 --- 时间 --- 节气2 ----
2929
long long diffA = pcal_->get_sec_by_date(datetime_, JieA);

box_qimen/qm_v4.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bool CQimenV4::run(const QiParam& info, CalendarType type)
1010
}
1111
pcal_->set_datetime(datetime_);
1212

13-
// 直接找出当月的节气信息,看在哪个节气的后面
13+
// 直接找出当月的节气信息,看在哪个节气的后面
1414
const CDateTime& JieA = pcal_->get_jie().jq[2].dt_;
1515
const CDateTime& JieB = pcal_->get_jie().jq[3].dt_;
1616

box_zhdata/zh_lang.cpp

+14-13
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ std::string CZhData::gua(int index)
2626
if (index < 0 || index > 8) {
2727
return "";
2828
}
29-
std::string result = std::string(gStr_Gua[index]);
29+
std::string result(gStr_Gua[index]);
3030
return result;
3131
}
3232

@@ -35,7 +35,7 @@ std::string CZhData::zs(int index)
3535
if (index < 0 || index > 11) {
3636
return "";
3737
}
38-
std::string result = std::string(gStr_ZhangSheng[index]);
38+
std::string result(gStr_ZhangSheng[index]);
3939
return result;
4040
}
4141

@@ -44,31 +44,32 @@ std::string CZhData::num(int index)
4444
if (index < 0 || index > 10) {
4545
return "";
4646
}
47-
std::string result = std::string(gStr_num[index]);
47+
std::string result(gStr_num[index]);
4848
return result;
4949
}
5050
std::string CZhData::mon(int index)
5151
{
5252
if (index < 0 || index > 11) {
5353
return "";
5454
}
55-
std::string result = std::string(gStr_ymc[index]);
55+
std::string result(gStr_ymc[index]);
5656
return result;
5757
}
5858
std::string CZhData::mon2(int index)
5959
{
6060
if (index < 0 || index > 11) {
6161
return "";
6262
}
63-
std::string result = std::string(gStr_ymc[index]) + "";
63+
std::string result(gStr_ymc[index]);
64+
result.append("");
6465
return result;
6566
}
6667
std::string CZhData::jq(int index)
6768
{ // 获取二十四节气名称,下标从公历 1 月的小寒开始
6869
if (index < 0 || index > 23) {
6970
return "";
7071
}
71-
std::string result = std::string(gStr_jq[index]);
72+
std::string result(gStr_jq[index]);
7273
return result;
7374
}
7475

@@ -77,7 +78,7 @@ std::string CZhData::lunar_day(int index)
7778
if (index < 0 || index > 29) {
7879
return "";
7980
}
80-
std::string result = std::string(gStr_lua[index]);
81+
std::string result(gStr_lua[index]);
8182
return result;
8283
}
8384
// 获取天干
@@ -86,7 +87,7 @@ std::string CZhData::gan(int index)
8687
if (index < 0 || index > 9) {
8788
return "";
8889
}
89-
std::string result = std::string(gStr_gan[index]);
90+
std::string result(gStr_gan[index]);
9091
return result;
9192
}
9293
// 获取地支
@@ -95,7 +96,7 @@ std::string CZhData::zhi(int index)
9596
if (index < 0 || index > 11) {
9697
return "";
9798
}
98-
std::string result = std::string(gStr_zhi[index]);
99+
std::string result(gStr_zhi[index]);
99100
return result;
100101
}
101102
// 获取六十甲子
@@ -104,7 +105,7 @@ std::string CZhData::jz(int index)
104105
if (index < 0 || index > 59) {
105106
return "";
106107
}
107-
std::string result = std::string(gStr_Jiazi[index]);
108+
std::string result(gStr_Jiazi[index]);
108109
return result;
109110
}
110111

@@ -114,7 +115,7 @@ std::string CZhData::jx(int index)
114115
if (index < 0 || index > 8) {
115116
return "";
116117
}
117-
std::string result = std::string(gStr_Jiuxing[index]);
118+
std::string result(gStr_Jiuxing[index]);
118119
return result;
119120
}
120121
// 获取八门
@@ -123,7 +124,7 @@ std::string CZhData::bm(int index)
123124
if (index < 0 || index > 8) {
124125
return "";
125126
}
126-
std::string result = std::string(gStr_Bamen[index]);
127+
std::string result(gStr_Bamen[index]);
127128
return result;
128129
}
129130
// 获取八神
@@ -132,7 +133,7 @@ std::string CZhData::bs(int index)
132133
if (index < 0 || index > 8) {
133134
return "";
134135
}
135-
std::string result = std::string(gStr_Bashen[index]);
136+
std::string result(gStr_Bashen[index]);
136137
return result;
137138
}
138139
// 获取空亡

0 commit comments

Comments
 (0)