[Graph] Fix cend function
authorSeoHyungjun <hyungjun.seo@samsung.com>
Thu, 29 Dec 2022 03:41:19 +0000 (12:41 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Wed, 1 Feb 2023 00:56:40 +0000 (09:56 +0900)
commit4934e9512c42f72e0a090fdf02407982fbd545cd
tree686c043c7a40c8ae94c5ba48739b5d45e5fc76fa
parenta32be7c5c3af908cda2863ca721c9b6aa0bcd14f
[Graph] Fix cend function

- Fix undefined behavior in cend() of \'graph_core.h\'

  The cend() function dereference node_list.cend(). This is undefined
  behavior because it accesses memory in an area that is not actually
  allowed. So changed cend() to operate normally through cbegin() + size.

  However, these changes also include problems. Usually, check that
  node_list is empty, and if it is, it will be treated as an exception.
  if use cbegin() and cend() when node_list is empty, there might be a
  problem. So, Added this caution at @note.

- Fixed a minor typo.

Related : #2086

**Self evaluation:**
1. Build test:   [X]Passed [ ]Failed [ ]Skipped
2. Run test:     [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: SeoHyungjun <hyungjun.seo@samsung.com>
nntrainer/graph/graph_core.h