Skip to content

Commit

Permalink
Fix issue mkrd#43 encodedOffset deprecated warning. Use utf16Offset(i…
Browse files Browse the repository at this point in the history
…n:) instead. (mkrd#44)

Thank you @verebes1
  • Loading branch information
verebes1 authored and twodayslate committed Oct 15, 2019
1 parent 0b353aa commit 67a1645
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Swift-Big-Number-Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2279,13 +2279,13 @@ public struct BDouble:
if let bi = BInt(nStr) {
self.init(bi, over: 1)
} else {
if let exp = nStr.firstIndex(of: "e")?.encodedOffset
if let exp = nStr.firstIndex(of: "e")?.utf16Offset(in: nStr)
{
let beforeExp = String(Array(nStr)[..<exp].filter{ $0 != "." })
var afterExp = String(Array(nStr)[(exp + 1)...])
var sign = false

if let neg = afterExp.firstIndex(of: "-")?.encodedOffset
if let neg = afterExp.firstIndex(of: "-")?.utf16Offset(in: afterExp)
{
afterExp = String(Array(afterExp)[(neg + 1)...])
sign = true
Expand Down

0 comments on commit 67a1645

Please sign in to comment.