@@ -26,7 +26,7 @@ std::string CZhData::gua(int index)
26
26
if (index < 0 || index > 8 ) {
27
27
return " " ;
28
28
}
29
- std::string result = std::string (gStr_Gua [index ]);
29
+ std::string result (gStr_Gua [index ]);
30
30
return result;
31
31
}
32
32
@@ -35,7 +35,7 @@ std::string CZhData::zs(int index)
35
35
if (index < 0 || index > 11 ) {
36
36
return " " ;
37
37
}
38
- std::string result = std::string (gStr_ZhangSheng [index ]);
38
+ std::string result (gStr_ZhangSheng [index ]);
39
39
return result;
40
40
}
41
41
@@ -44,31 +44,32 @@ std::string CZhData::num(int index)
44
44
if (index < 0 || index > 10 ) {
45
45
return " " ;
46
46
}
47
- std::string result = std::string (gStr_num [index ]);
47
+ std::string result (gStr_num [index ]);
48
48
return result;
49
49
}
50
50
std::string CZhData::mon (int index)
51
51
{
52
52
if (index < 0 || index > 11 ) {
53
53
return " " ;
54
54
}
55
- std::string result = std::string (gStr_ymc [index ]);
55
+ std::string result (gStr_ymc [index ]);
56
56
return result;
57
57
}
58
58
std::string CZhData::mon2 (int index)
59
59
{
60
60
if (index < 0 || index > 11 ) {
61
61
return " " ;
62
62
}
63
- std::string result = std::string (gStr_ymc [index ]) + " 月" ;
63
+ std::string result (gStr_ymc [index ]);
64
+ result.append (" 月" );
64
65
return result;
65
66
}
66
67
std::string CZhData::jq (int index)
67
68
{ // 获取二十四节气名称,下标从公历 1 月的小寒开始
68
69
if (index < 0 || index > 23 ) {
69
70
return " " ;
70
71
}
71
- std::string result = std::string (gStr_jq [index ]);
72
+ std::string result (gStr_jq [index ]);
72
73
return result;
73
74
}
74
75
@@ -77,7 +78,7 @@ std::string CZhData::lunar_day(int index)
77
78
if (index < 0 || index > 29 ) {
78
79
return " " ;
79
80
}
80
- std::string result = std::string (gStr_lua [index ]);
81
+ std::string result (gStr_lua [index ]);
81
82
return result;
82
83
}
83
84
// 获取天干
@@ -86,7 +87,7 @@ std::string CZhData::gan(int index)
86
87
if (index < 0 || index > 9 ) {
87
88
return " " ;
88
89
}
89
- std::string result = std::string (gStr_gan [index ]);
90
+ std::string result (gStr_gan [index ]);
90
91
return result;
91
92
}
92
93
// 获取地支
@@ -95,7 +96,7 @@ std::string CZhData::zhi(int index)
95
96
if (index < 0 || index > 11 ) {
96
97
return " " ;
97
98
}
98
- std::string result = std::string (gStr_zhi [index ]);
99
+ std::string result (gStr_zhi [index ]);
99
100
return result;
100
101
}
101
102
// 获取六十甲子
@@ -104,7 +105,7 @@ std::string CZhData::jz(int index)
104
105
if (index < 0 || index > 59 ) {
105
106
return " " ;
106
107
}
107
- std::string result = std::string (gStr_Jiazi [index ]);
108
+ std::string result (gStr_Jiazi [index ]);
108
109
return result;
109
110
}
110
111
@@ -114,7 +115,7 @@ std::string CZhData::jx(int index)
114
115
if (index < 0 || index > 8 ) {
115
116
return " " ;
116
117
}
117
- std::string result = std::string (gStr_Jiuxing [index ]);
118
+ std::string result (gStr_Jiuxing [index ]);
118
119
return result;
119
120
}
120
121
// 获取八门
@@ -123,7 +124,7 @@ std::string CZhData::bm(int index)
123
124
if (index < 0 || index > 8 ) {
124
125
return " " ;
125
126
}
126
- std::string result = std::string (gStr_Bamen [index ]);
127
+ std::string result (gStr_Bamen [index ]);
127
128
return result;
128
129
}
129
130
// 获取八神
@@ -132,7 +133,7 @@ std::string CZhData::bs(int index)
132
133
if (index < 0 || index > 8 ) {
133
134
return " " ;
134
135
}
135
- std::string result = std::string (gStr_Bashen [index ]);
136
+ std::string result (gStr_Bashen [index ]);
136
137
return result;
137
138
}
138
139
// 获取空亡
0 commit comments