Skip to content

Commit 363d319

Browse files
authored
Merge pull request #900 from goingforstudying-ctrl/main
Fix misleading comment regarding storage struct reference in 06_ArrayAndStruct (#898)
2 parents 9f02c6a + a7d9366 commit 363d319

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

06_ArrayAndStruct/ArrayAndStruct.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ contract StructTypes {
4343
// 给结构体赋值
4444
// 方法1:在函数中创建一个storage的struct引用
4545
function initStudent1() external{
46-
Student storage _student = student; // assign a copy of student
46+
Student storage _student = student; // assign a reference to student
4747
_student.id = 11;
4848
_student.score = 100;
4949
}

06_ArrayAndStruct/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Student student; // 初始一个student结构体
115115
// 给结构体赋值
116116
// 方法1:在函数中创建一个storage的struct引用
117117
function initStudent1() external{
118-
Student storage _student = student; // assign a copy of student
118+
Student storage _student = student; // assign a reference to student
119119
_student.id = 11;
120120
_student.score = 100;
121121
}

Languages/en/06_ArrayAndStruct_en/ArrayAndStruct.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ contract StructTypes {
4444
// assign value to structure
4545
// Method 1: Create a storage struct reference in the function
4646
function initStudent1() external{
47-
Student storage _student = student; // assign a copy of student
47+
Student storage _student = student; // assign a reference to student
4848
_student.id = 11;
4949
_student.score = 100;
5050
}

Languages/en/06_ArrayAndStruct_en/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ You can define new types in the form of `struct` in Solidity. Elements of `struc
9393
// assign value to structure
9494
// Method 1: Create a storage struct reference in the function
9595
function initStudent1() external{
96-
Student storage _student = student; // assign a copy of student
96+
Student storage _student = student; // assign a reference to student
9797
_student.id = 11;
9898
_student.score = 100;
9999
}

Languages/ja/06_ArrayAndStruct_ja/ArrayAndStruct.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ contract StructTypes {
4444
// assign value to structure(構造体への値の代入)
4545
// Method 1: Create a storage struct reference in the function(関数内でstorage型の構造体の参照を作成する)
4646
function initStudent1() external{
47-
Student storage _student = student; // assign a copy of student(構造体studentのコピーを代入する
47+
Student storage _student = student; // assign a reference to student(構造体studentへの参照を代入する
4848
_student.id = 11;
4949
_student.score = 100;
5050
}

Languages/ja/06_ArrayAndStruct_ja/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Solidityにおいて、`struct`というフォーマットによって新しい
9494
// Method 1: Create a storage struct reference in the function
9595
//(方法1: 関数にてstorage型構造体の参照を作成する)
9696
function initStudent1() external{
97-
Student storage _student = student; // assign a copy of student
97+
Student storage _student = student; // assign a reference to student
9898
_student.id = 11;
9999
_student.score = 100;
100100
}

0 commit comments

Comments
 (0)