Update ch4-03.md

Fix typo of `hasEdge`
pull/102/head
suntong 2022-03-25 14:48:12 -04:00 committed by GitHub
parent 40c4fa9928
commit 693872d890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ func hasEdge(from, to string) bool {
}
```
其中addEdge函数惰性初始化map是一个惯用方式也就是说在每个值首次作为key时才初始化。addEdge函数显示了如何让map的零值也能正常工作即使from到to的边不存在graph[from][to]依然可以返回一个有意义的结果。
其中addEdge函数惰性初始化map是一个惯用方式也就是说在每个值首次作为key时才初始化。hasEdge函数显示了如何让map的零值也能正常工作即使from到to的边不存在graph[from][to]依然可以返回一个有意义的结果。
**练习 4.8** 修改charcount程序使用unicode.IsLetter等相关的函数统计字母、数字等Unicode中不同的字符类别。