Skip to content
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
4 changes: 2 additions & 2 deletions syntax/02-datatypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ list.push_back(2)
list.push_back(3)

# 访问元素
var first = list.front()
var last = list.back()
var first = list.front
var last = list.back

# 删除元素
list.pop_back()
Expand Down
2 changes: 1 addition & 1 deletion syntax/04-control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ end

```covscript
function findMax(arr)
if arr.empty()
if arr.empty
return null
end

Expand Down
2 changes: 1 addition & 1 deletion syntax/08-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class ObjectPool

function acquire()
if this.available.size > 0
var obj = this.available.back()
var obj = this.available.back
this.available.pop_back()
this.inUse.push_back(obj)
return obj
Expand Down
4 changes: 2 additions & 2 deletions syntax/09-exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class HttpClient
function get(url)
try
# 验证 URL
if url == null || url.empty()
if url == null || url.empty
throw new InvalidArgumentException("url", "URL cannot be empty")
end

Expand Down Expand Up @@ -485,7 +485,7 @@ end
```covscript
class Validator
function validateEmail(email)
if email == null || email.empty()
if email == null || email.empty
throw new InvalidArgumentException("email", "cannot be empty")
end

Expand Down
Loading