| 2020 | } |
| 2021 | |
| 2022 | func (l *List) ValueWithLockHeld(readTs uint64) (rval types.Val, rerr error) { |
| 2023 | val, found, err := l.findValue(readTs, math.MaxUint64) |
| 2024 | if err != nil { |
| 2025 | return val, errors.Wrapf(err, |
| 2026 | "cannot retrieve default value from list with key %s", hex.EncodeToString(l.key)) |
| 2027 | } |
| 2028 | if !found { |
| 2029 | return val, ErrNoValue |
| 2030 | } |
| 2031 | return val, nil |
| 2032 | } |
| 2033 | |
| 2034 | // ValueFor returns a value from posting list, according to preferred language list. |
| 2035 | // If list is empty, value without language is returned; if such value is not |