gitlab.com/evatix-go/core@v1.3.55/coresort/strsort/Quick.go (about)

     1  package strsort
     2  
     3  import (
     4  	"sort"
     5  
     6  	"gitlab.com/evatix-go/core/coredata"
     7  )
     8  
     9  // QuickPtr Warning: Data gets mutated inside.
    10  //
    11  // Reference : https://play.golang.org/p/_OkY82E2kO9
    12  func QuickPtr(pointerStringsIn *[]*string) *[]*string {
    13  	pointerStrings := coredata.PointerStrings(*pointerStringsIn)
    14  	sort.Sort(pointerStrings)
    15  
    16  	return pointerStringsIn
    17  }
    18  
    19  // Quick Warning: Data gets mutated inside.
    20  //
    21  // Reference : https://play.golang.org/p/sJ8a464USeV
    22  func Quick(stringsPointerIn *[]string) *[]string {
    23  	sort.Strings(*stringsPointerIn)
    24  
    25  	return stringsPointerIn
    26  }
    27  
    28  // QuickDscPtr Warning: Data gets mutated inside.
    29  //
    30  // Reference : https://play.golang.org/p/_OkY82E2kO9
    31  func QuickDscPtr(pointerStringsIn *[]*string) *[]*string {
    32  	pointerStringsDsc := coredata.PointerStringsDsc(*pointerStringsIn)
    33  	sort.Sort(pointerStringsDsc)
    34  
    35  	return pointerStringsIn
    36  }
    37  
    38  // QuickDsc Warning: Data gets mutated inside.
    39  //
    40  // Reference : https://play.golang.org/p/sJ8a464USeV
    41  func QuickDsc(stringsPointerIn *[]string) *[]string {
    42  	pointerStringsDsc := coredata.StringsDsc(*stringsPointerIn)
    43  	sort.Sort(pointerStringsDsc)
    44  
    45  	return stringsPointerIn
    46  }