Refactored string_set_at and added documentation
This commit is contained in:
@@ -5,7 +5,7 @@ aspects (internal design, memory layout, etc.) of the `Vector` data structure.
|
||||
`Vector` is a dynamic array with generic data type support; this means that you can store
|
||||
any kind of homogenous value on this data structure. Resizing is performed automatically
|
||||
by increasing the capacity by 1.5 times when the array becomes full. Internally, this
|
||||
data structure is represented by the following structure:
|
||||
data structure is represented by the following layout:
|
||||
|
||||
```c
|
||||
typedef struct {
|
||||
@@ -39,7 +39,7 @@ At the time being, `Vector` supports the following methods:
|
||||
- `size_t vector_size(vector)`: return vector size (i.e., the number of elements);
|
||||
- `size_t vector_capacity(vector)`: return vector capacity (i.e., vector total size).
|
||||
|
||||
As you can see by the previous function signatures, most methods that operate
|
||||
As you can see from the previous function signatures, most methods that operate
|
||||
on the `Vector` data type return a custom type called `vector_result_t` which is
|
||||
defined as follows:
|
||||
|
||||
@@ -66,7 +66,7 @@ Each method that returns such type indicates whether the operation was successfu
|
||||
by setting the `status` field and by providing a descriptive message on the `message`
|
||||
field. If the operation was successful (that is, `status == VECTOR_OK`), you can either
|
||||
move on with the rest of the program or read the returned value from the sum data type. Of course, you can choose to
|
||||
ignore the return value (if you're brave enough :D) as illustrated in the first part of the README.
|
||||
ignore the return value (if you're brave enough :D) as illustrated on the first part of the README.
|
||||
|
||||
## Functional methods
|
||||
`Vector` provides three functional methods called `map`, `filter` and `reduce` which allow the caller to apply a computation to the vector,
|
||||
|
||||
Reference in New Issue
Block a user